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​
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
If this what you need?
Book1
ABCDEF
1NameGradeClassDate
2Steve10B0112/01/2019
3Steve10B1412/08/2019
4Steve10D4212/07/2019
5Tom12B0108/07/2020
6Tom12B7508/07/2020
7
8
9NameGradeB01B14B75D42
10Steve1012/01/201912/08/2019 12/07/2019
11Tom1208/07/2020 08/07/2020 
Sheet6
Cell Formulas
RangeFormula
C10:F11C10=IFERROR(1/(1/MINIFS($D$2:$D$6,$C$2:$C$6,C$9,$A$2:$A$6,$A10)),"")
 
Upvote 0
Please update your account details to show which version of Excel you are using, as this affects what functions you can use.

Two other options depending on your version
+Fluff v2.xlsm
ABCDEF
1NameGradeClassDate
2Steve10B0112/01/2019
3Steve10B1412/08/2019
4Steve10D4212/07/2019
5Tom12B0108/07/2020
6Tom12B7508/07/2020
7
8
9NameGradeB01B14B75D42
10Steve1012/01/201912/08/2019 12/07/2019
11Tom1208/07/2020 08/07/2020 
12NameGradeB01B14B75D42
13Steve1012/01/201912/08/2019 12/07/2019
14Tom1208/07/2020 08/07/2020 
15
Summary
Cell Formulas
RangeFormula
C10:F11C10=IFERROR(AGGREGATE(15,6,$D$2:$D$6/($A$2:$A$6=$A10)/($C$2:$C$6=C$9),1),"")
C13:F14C13=FILTER($D$2:$D$6,($A$2:$A$6=$A13)*($C$2:$C$6=C$12),"")
 
Upvote 0
Please update your account details to show which version of Excel you are using, as this affects what functions you can use.

Two other options depending on your version
+Fluff v2.xlsm
ABCDEF
1NameGradeClassDate
2Steve10B0112/01/2019
3Steve10B1412/08/2019
4Steve10D4212/07/2019
5Tom12B0108/07/2020
6Tom12B7508/07/2020
7
8
9NameGradeB01B14B75D42
10Steve1012/01/201912/08/2019 12/07/2019
11Tom1208/07/2020 08/07/2020 
12NameGradeB01B14B75D42
13Steve1012/01/201912/08/2019 12/07/2019
14Tom1208/07/2020 08/07/2020 
15
Summary
Cell Formulas
RangeFormula
C10:F11C10=IFERROR(AGGREGATE(15,6,$D$2:$D$6/($A$2:$A$6=$A10)/($C$2:$C$6=C$9),1),"")
C13:F14C13=FILTER($D$2:$D$6,($A$2:$A$6=$A13)*($C$2:$C$6=C$12),"")
I've updated my account to show that I'm working off of MS2013....sorry about that. As far as the solutions, I've tried both of them, and neither worked. I believe that's my fault for not posting the issue correctly, so allow me to try again.

I have a workbook entitled PS. On that workbook are 842 unique names. Each name could have taken up to 144 classes. Each class has a Scheduled and Actual date. Unfortunately, the way I was provided the data, each class for each person, is listed as a record. So, if Steve took 3 classes, he has 3 records. I'm trying to add the class scheduled and actual dates as column headers (288 in total), then fill the dates in. In my mind, that would just allow me to delete duplicates, and I would end up with 842 records, with all of the class scheduled and actual completion dates filled in, in the appropriate class ID.

In the example I provided above, the 2nd table is actually a separate worksheet, as I thought nesting IF and VLOOKUP statements was going to be the route to go. My apologies for not calling out the other worksheet, as it probably impacted the solutions offered.

Hopefully that helps.
 
Upvote 0
If the data is on another sheet, then just add the sheet name like
Excel Formula:
=IFERROR(AGGREGATE(15,6,Sheet1!$D$2:$D$6/(Sheet1!$A$2:$A$6=$A11)/(Sheet1!$C$2:$C$6=C$9),1),"")
 
Upvote 0
If the data is on another sheet, then just add the sheet name like
Excel Formula:
=IFERROR(AGGREGATE(15,6,Sheet1!$D$2:$D$6/(Sheet1!$A$2:$A$6=$A11)/(Sheet1!$C$2:$C$6=C$9),1),"")
Still no joy. I triple checked the formula, and don't see where I've gone off at.
Excel Formula:
=IFERROR(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
If you remove the iferror part of the formula, what do you get?
 
Upvote 0
If you remove the iferror part of the formula, what do you get?
This results in a #NUM error. The dates are formatted as dates (MM/DD/YY), the "names" are actually account numbers formatted as text, and the "classes" are formatted as general.
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
Change the format of col BD from date to general, do you see 6 figure numbers?
 
Upvote 0
Change the format of col BD from date to general, do you see 6 figure numbers?
I changed the formatting to general, and see 5 digit numbers. I reevaluated the formula, and the #NUM issue remained.
 
Upvote 0

Forum statistics

Threads
1,214,635
Messages
6,120,660
Members
448,975
Latest member
sweeberry

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