Nesting IF and VLOOKUP formulas

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
701
Office Version
  1. 365
Platform
  1. Windows
I have a worksheet with 13K+ records, structured similarly to the first underlying table.

I'm trying to figure out how I can get to something that looks like the second underlying table. I was thinking that I could nest some IF statements in with some VLOOKUPs, but my brain isn't working with me today.


NameGradeClassDate
Steve
10​
B01
12/1/2019​
Steve
10​
B14
12/8/2019​
Steve
10​
D42
12/7/2019​
Tom
12​
B01
8/7/2020​
Tom
12​
B75
8/7/2020​
NameGradeB01B14B75D42
Steve
10​
12/1/2019​
12/8/2019​
12/7/2019​
Tom
12​
8/7/2020​
8/7/2020​
 
In that case you need to check that the values in A2 & BQ1 actually exist in the other workbook, bearing in mind that if you change the format of a cell you are not changing the underlying value. So if you input a number & then format the cell as text, it is still a number. Also check that there are no leading/trailing spaces
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
In that case you need to check that the values in A2 & BQ1 actually exist in the other workbook, bearing in mind that if you change the format of a cell you are not changing the underlying value. So if you input a number & then format the cell as text, it is still a number. Also check that there are no leading/trailing spaces
I did that by entering the formula in a cell where I know I should return a value.
 
Upvote 0
the "names" are actually account numbers formatted as text
Is that the same for both the source data and the row headings in the output table? 12345 formatted as general / number is not equal to 12345 formatted as text.
Either you have used an incorrect range in the formula or the data types are not matching, there are no other reasons for the aggregate formula to fail.

edit:-

Just noticed 2 missing brackets in the formula, see if this works.

Excel Formula:
=AGGREGATE(15,6,'[passportSheet_120851.xlsx]Rows 1 - 94145'!$BD$2:$BD$13229/('[passportSheet_120851.xlsx]Rows 1 - 94145'!$A$2:$A$13229=$A2)/('[passportSheet_120851.xlsx]Rows 1 - 94145'!$BB$2:$BB$13229=BQ$1),1)
 
Upvote 0
Is that the same for both the source data and the row headings in the output table? 12345 formatted as general / number is not equal to 12345 formatted as text.
Either you have used an incorrect range in the formula or the data types are not matching, there are no other reasons for the aggregate formula to fail.

edit:-

Just noticed 2 missing brackets in the formula, see if this works.

Excel Formula:
=AGGREGATE(15,6,'[passportSheet_120851.xlsx]Rows 1 - 94145'!$BD$2:$BD$13229/('[passportSheet_120851.xlsx]Rows 1 - 94145'!$A$2:$A$13229=$A2)/('[passportSheet_120851.xlsx]Rows 1 - 94145'!$BB$2:$BB$13229=BQ$1),1)
Well, that appears to be working. I won't know until the formulas are done evaluating, which is going to take a while on this stone age machine I have. Thanks for the help!
 
Upvote 0
Good spot Jason, missed that completely.
 
Upvote 0

Forum statistics

Threads
1,216,106
Messages
6,128,863
Members
449,473
Latest member
soumyahalder4

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