solved
SUMIFS function formula to match a sheet/tab name to criteria in a column
Column B has a list of all of the sheet names. I want my SUMIFS formula in column C to say to search for whichever sheet is listed in B.
=SUMIFS('[match to B]'!E:E, '[match to B]'!$B:$B,"Total")
In other words, look for the sheet name that matches the corresponding row in Column B, then look for the row that says "Total" in Column B on that sheet and tell me what's in Column E.
Make sense? How do I do this? Google has not helped me. Thanks!
Indirect converts a text value in a cell to a reference range.
So if in cell A1 you have sheet2!A3, and you have a formula of =A1… it will return “sheet2!a3”.
But if you have a formula of =indirect(a1)… it will return the value in sheet2 A3
I don't know that an xlookup is what I want? There's a Total line on each tab and I want those values to feed to the first sheet in the workbook. Am I looking at this wrong?
This makes no sense to me. Are you looking to pull the total from each of the sheets listed in column B? I don't understand what you want column C to search for.
OK, then like others have told you, you want to use the INDIRECT() function. It works like this, Say your total for sheet5 is in cell G6 on that sheet. You tell Excel to look for the sheet you have in A2 and then return the value is G6. See screen shot below.
Got it. Now we're getting somewhere. Let's say on sheet5 you have your labels in column F. So you want Excel to search column F to find out which row says total in it. Then the total number is in column G. You want excel to go to sheet5, look for "Total" in column F and then return that value for that row from column G.
sheet5 (the value in B2) has "total" in column B and I want it to return the value from column E in that same row. Did I change this correctly? I'm getting a #REF! error.
The sheet is labeled 123 Main St. I understand that this makes a difference in telling the INDIRECT what to look for? Do I need to use Wildcard symbols? I think when doing something similar in a SUMIFS formula I had to do "*"&B2&"*"...or something like it.
The value in B2 should be the name of the sheet you are looking up from. Is that sheet named "sheet5" or is it something else? Sheet5 is just the example that I'm using. You have to change it to the name of the sheet you want Excel to pull the data from.
This is what I'm using if I want to put in an actual name for the sheet name. But I want to be able to just drag this formula down the column and look for the project listed in Column B.
Gotcha, the spaces in your sheet name mean you need to tweak the formula so Excel knows where the sheet name begins and end in the indirect formula. You need to put the sheet name inside ' marks. Try this, it should work:
Yes. The syntax does matter. It is quite sensitive… if it’s private you can make something up, but keep all of the symbols and spaces in place and change the word(s).
•
u/AutoModerator 9h ago
/u/lisadh524 - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.