Share via

IF statement across multiple worksheets

Anonymous
2024-07-12T17:28:53+00:00

I need help making an IF formula on excel that works like this: “if there is utilization data for a person's name, paste the utilization data on Sheet 7.” And that same formula can be applied throughout the spreadsheet to avoid manually copy and pasting.

Might look something like:

IF (“persons name” = “utilization actual” , then …. )

but I am not sure if this is possible.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2024-07-22T08:09:51+00:00

    Hi,

    I apologize for bothering you again, but have you tried the function provided by Lucy? That is also a great solution.
    If you prefer to enhance your macro to achieve some automated processes, you're welcome to share your workbook with me. I will help you debug the program and send the file back to you.

    Looking forward to your reply!

    Thomas

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-07-17T08:10:03+00:00

    Hi Amina Torres

    Suppose you have two tables.

    Sheet 1: contains all your data.

    Sheet 2: contains the table you are currently working on.

    Please use the following formula in cell B1 of Sheet 2 and drag down to fill.

    =IFERROR(VLOOKUP(A2,All!A:B,2,FALSE),"")

    This formula retrieves the name in column A of Sheet 2 from Sheet 1. If the name exists, the score corresponding to the name will be returned.

    If the name does not exist, it will not be returned.

    I have shared this file with you via private message, if you have questions, feel free to let me know.

    Best regards

    LucyW-MSFT | Microsoft Community Support Specialist

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-07-17T06:47:48+00:00

    Hi,
    I noticed that you marked my previous response as "unhelpful." I apologize for any oversight in my earlier reply.

    If it's convenient for you, could you please share your workbook with me via private message?

    I can assist you with editing and testing the macro program. Once everything is verified to be correct, I will send the file back to you.

    Looking forward to your response!

    Thomas

    Was this answer helpful?

    0 comments No comments
  4. Ashish Mathur 102K Reputation points Volunteer Moderator
    2024-07-12T23:41:52+00:00

    Hi,

    Share data in a format that can be pasted in an MS Excel file. Show the expected result very clearly.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2024-07-12T18:45:05+00:00

    Hi Amina Torres,
    Thanks for your post in Microsoft Community.

    Unfortunately, the IF function can only simply evaluate whether a condition is true or false and then return predefined data based on that. It cannot perform operations akin to "pasting." This might be achievable through VBA (Visual Basic for Applications).

    I'll demonstrate the outcome in this response, as the script I've written assumes matching columns, and there are parameters that need to be adjusted based on your specific situation. 

    Suppose I have a list of names in column A of Sheet1, and the corresponding actual data in column C. 

    I also have a column of names in column B of Sheet2, but some of these names do not appear in column A of Sheet1, thus requiring matching names from Sheet1's column A to fill in the data.

    After running the macro:

    Even if you add new names to column A of Sheet2 later on, they can still be matched accordingly.

    If the above demonstration meets your requirements, please share with me the actual names of your source sheet and destination sheet, which column in the source sheet contains the names to match, which column holds the actual data, and which column in the destination sheet is for matching names, and which column is for the actual paste. I will then adjust the parameters based on your response, test the code, and share it with you.

    I look forward to your reply!

    Best Regards, 
    Thomas C - MSFT | Microsoft Community Support Specialist

    Was this answer helpful?

    0 comments No comments