Help with lookup

Cpanc

New Member
Joined
Dec 6, 2024
Messages
7
Office Version
  1. 365
I am unable to find a solution to this issue. We have a file where we have multiple header columns and it is dynamic in a sense. Every month we can have new rows and new columns to the dataset. As seen in example photo below I am trying to lookup number for specific cell by row column headers.
Thank you all!
 

Attachments

  • image0.jpeg
    image0.jpeg
    120.2 KB · Views: 14

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello, one way to address this could be:

Excel Formula:
=LET(
a,TOCOL(B5:I16),
b,TOCOL((A5:A16=K8)*(B2:I2=K5)*(B3:I3=K6)*(B4:I4=K7)),
FILTER(a,b=1))
 
Upvote 0
Welcome. Once you get settled here, you'll find better tools to show your sheet data, like XL2BB. Get that quickly

You could add a helper row in row 1 and put a formula to merge those three headers.
=B2&B3&B4
copy that to the other cells over the headers and also to Cell K4.
Then you could use:
Book2
ABCDEFGHIJKL
1AB FEE Level 1 Class AAB FEE Level 1 Class BAB FEE Level 2 Class AAB FEE Level 2 Class BCD FEE Level 1 Class CCD FEE Level 1 Class DCD FEE Level 2 Class CCD FEE Level 2 Class D
2AB FEEAB FEEAB FEEAB FEECD FEECD FEECD FEECD FEE
3Level 1Level 1Level 2Level 2Level 1Level 1Level 2Level 2
4Class AClass BClass AClass BClass CClass DClass CClass DAB Fee Level 2 Class A
51/31/2024110203040506070AB Fee
62/29/2024211213141516171Level 2
73/31/2024312223242526272Class A
84/30/20244132333435363733/31/202422
95/31/2024514243444546474
106/30/2024615253545556575
117/31/2024716263646566676
128/31/2024817273747576777
139/30/2024918283848586878
1410/31/20241019293949596979
1511/30/20241120304050607080
1612/31/20241221314151617181
Sheet2
Cell Formulas
RangeFormula
B1:I1,K4B1=B2&" "&B3&" "&B4
L8L8=VLOOKUP(K8,A5:I16,MATCH(K4,B1:I1,0)+1,FALSE)
A6:A16A6=EOMONTH(A5,1)
 
Upvote 0
Thank you for the responses. I will download the tool as well. Helper column is an option but very difficult. We get 50 of such tabs this weekly and they go to column FZ in most cases. Should have mentioned earlier but trying to set up something on a different sheet where everything just pulls in.
 
Upvote 0
Hello, one way to address this could be:

Excel Formula:
=LET(
a,TOCOL(B5:I16),
b,TOCOL((A5:A16=K8)*(B2:I2=K5)*(B3:I3=K6)*(B4:I4=K7)),
FILTER(a,b=1))
Somehow getting a calc error. Will check on to it. Can this formula include blank rows and columns? Coz the sheet we get has many blank rows and columns in between
 
Upvote 0
Disregard the helper row

Book2
ABCDEFGHIJKL
2AB FEEAB FEEAB FEEAB FEECD FEECD FEECD FEECD FEE
3Level 1Level 1Level 2Level 2Level 1Level 1Level 2Level 2
4Class AClass BClass AClass BClass CClass DClass CClass D
51/31/2024110203040506070AB Fee
62/29/2024211213141516171Level 2
73/31/2024312223242526272Class A
84/30/20244132333435363733/31/202422
95/31/2024514243444546474
106/30/2024615253545556575
117/31/2024716263646566676
128/31/2024817273747576777
139/30/2024918283848586878
1410/31/20241019293949596979
1511/30/20241120304050607080
1612/31/20241221314151617181
Sheet2
Cell Formulas
RangeFormula
L8L8=VLOOKUP(K8,A5:I16,MATCH(K5&K6&K7,B2:I2&B3:I3&B4:I4,0)+1,FALSE)
A6:A16A6=EOMONTH(A5,1)
 
Upvote 0
Welcome to the MrExcel board!

Based on that sample data, another option might be
Excel Formula:
=SUMPRODUCT((B2:I2=K5)*(B3:I3=K6)*(B4:I4=K7)*(A5:A16=K8),B5:I16)
 
Upvote 0
Somehow getting a calc error. Will check on to it. Can this formula include blank rows and columns? Coz the sheet we get has many blank rows and columns in between
This works as well. Was an error on my end. Thank you
 
Upvote 0
So thanks for all your help. All the solutions provided work. I have another follow up question though. Some of headers in the file are merged. For example AB Fee is merged from B to E. Would there be a fix for this issue? Vlookup only picks up the first value in this case.

Thank you
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top