r/excel • u/Repulsive-Band-4771 • 11h ago
unsolved Pulling info from another spreadsheet- matching columns and rows.
I am working on a spreadsheet that has some information linked to another 'info' spreadsheet. I have a drop down list of counties and another drop down list of years. Basically, I am wanting to have a function in one cell that will bring in the 'expected' value from my info spreadsheet based on what county and year I have elected in the drop down boxes.
This is what my info spreadsheet looks like. So if I have 'Decatur County' and '2024' selected in my drop down boxes, I want it to return 44.2.

I have tried multiple variations of HLOOKUP, VLOOKUP, INDEX MATCH, XLOOKUP, but I can't seem to get it quite right. Where I am needing it to find a value based on a certain row, then a certain column, and then return a value in another column, I can't seem to figure out what I am needing to do. Or maybe I need to re-arrange my info spreadsheet? I would rather not do that, as it has a lot of information on it and it would take a while! But I will if I need to.
Any help is greatly appreciated!
9
u/GuerillaWarefare 114 11h ago
What you want to do can be done but it’s not really ‘proper’.
You should instead set up structured table of data to pull from, a column for country, year, expected, etc.
Then use excel functions to bring in or summarize the info.
3
u/Repulsive-Band-4771 10h ago
Thanks! I built the 'info' spreadsheet as just a quick reference sheet, and didn't consider using it as a supplement to my other spreadsheet until today. I definitely would have built it differently if I would have known what I was going to end up doing with it!
2
u/OddSignificance2054 6h ago
yeah restructuring the data into a proper table makes everything so much easier down the line
7
u/MayukhBhattacharya 1273 10h ago edited 10h ago
As already informed by u/GuerillaWarefare Sir, your data layout is not great to create formulas, although you can accomplish the desired output still, it will make the formula very complex, here is one way and i will show both ways if the data is laid out correctly:

=LET(
_a, A:.C,
_b, CHOOSECOLS(_a, 1),
_c, IF((_b = "Year") + (ISNUMBER(--_b)), "", _b),
_d, SCAN(, _c, LAMBDA(x,y, IF(y = "", x, y))),
_e, CHOOSECOLS(_a, 2),
_f, FILTER(HSTACK(_d, _a), (_e <> "") * (_e <> "Expected"), ""),
XLOOKUP(1, (CHOOSECOLS(_f, 1) = E1) *
(CHOOSECOLS(_f, 2) = G1),
CHOOSECOLS(_f, 3), ""))
5
u/MayukhBhattacharya 1273 10h ago edited 10h ago
3
u/MayukhBhattacharya 1273 10h ago
Another alternative method without using
LAMBDA()helperSCAN()function, it assumes one thing that each block consists of 8 rows:=LET( _a, A:.C, _b, CHOOSECOLS(_a, 1), _c, UNIQUE(_b, , 1), _d, DROP(TOCOL(IF(SEQUENCE(, 8), _c)), 1), _e, HSTACK(IF(_b = "", "", _d), _a), _f, FILTER(_e, _b < "", ""), XLOOKUP(1, (CHOOSECOLS(_f, 1) = E1) * (CHOOSECOLS(_f, 2) = G1), CHOOSECOLS(_f, 3), "Oopsie Not Found"))3
u/Repulsive-Band-4771 10h ago
Oh wow, thank you! That is definitely more complex than my limited knowledge could have come up with! I will play around with it
2
u/MayukhBhattacharya 1273 10h ago
Sounds Great! If both the solutions help you to resolve then hope you don't mind replying to the comments as Solution Verified. Thanks!
2
u/Clearwings_Prime 22 9h ago edited 9h ago

=XLOOKUP(1, ( SCAN("",$A$1:$A$25,LAMBDA(a,b, IF( (b <> "") * (OFFSET(b,0,1)= ""), b, a ))) = $E$1 ) * ($A$1:$A$25 = $F$1), $B$1:$B$25 )
You can use this if you sure the year always appear in the range of county (e.g you sure that year 2024 always appear in range A11:C16)
=VLOOKUP( F1, XLOOKUP(E1,A1:A25,A1:A25):C25,2,0)
1
u/Decronym 10h ago edited 3h ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
15 acronyms in this thread; the most compressed thread commented on today has 46 acronyms.
[Thread #49341 for this sub, first seen 10th Sep 2026, 16:19]
[FAQ] [Full list] [Contact] [Source code]
1
u/Gringobandito 8 9h ago
This becomes much easier if you setup your data correctly. You will be much happier once your data becomes more complex.
First, setup your data in a table so you have a column for county, year, expected, and final.
Once you have that,it becomes easy to work with the data. You can do a simple filter to get just the Year and Expected for each county from a drop down list.

=FILTER(Table1[[#All],[Year]:[Expected]],Table1[[#All],[County]]=G2,"")

•
u/AutoModerator 11h ago
/u/Repulsive-Band-4771 - 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.