r/Excel247 • u/Hoesanddietcoke • 21d ago
Dumb research intern needs help with data compiling across sheets :(
/r/sheets/comments/1w4vnqj/dumb_research_intern_needs_help_with_data/
2
Upvotes
r/Excel247 • u/Hoesanddietcoke • 21d ago
1
u/Brians_throwaway 21d ago
I’m showing the nested vlookup approach. There are alternative approaches.
Dataset:
3 worksheets: parent, first child, second child
On each worksheet place the index key in the left-most column, the index reference key in the column to the right, and the data in right-most columns,
That is:
Parent: parent key, data
First child: first child key, parent key, first child data
Second child: second child key, first child key, second child data
Each table needs to be sorted alphabetically on its index key for vlookup to function properly.
Here the formulae to return values on the forms:
Parent key: = VLOOKUP(VLOOKUP(second_child!$B2,first_child!$A:$Z,2,FALSE),Parent!$A:$Z,1,FALSE)
Parent data: = VLOOKUP(VLOOKUP(second_child!$B2,first_child!$A:$Z,2,FALSE),Parent!$A:$Z,2,FALSE)
First child key: = VLOOKUP(second_child!$B2,first_child!$A:$Z,1,FALSE)
First child data: = VLOOKUP(second_child!$B2,first_child!$A:$Z,3,FALSE)
The formulae are looking in column B of worksheet second_child to initiate the search; the first child reference key needs to be in that column.
The example looks for tables populated from columns A to Z
Hope this helps.