Lookup based on date and name

AlbertanFireFly

New Member
Joined
Jan 23, 2014
Messages
21
Hi,

I'm a fitness instructor, and I have an excel file to keep track of my classes, the date and time, the student's name, and whether they paid cash or used a punchcard. Right now, my master sheet looks like:

Date Student Punchcard
10-Jan Mary 4/10
10-Jan Kim 2/5
10-Jan Colleen 7/10
15-Jan Mary 5/10
15-Jan Kim 3/5
20-Jan Mary 6/10
20-Jan Colleen 8/10


What I would like to be able to do, is have a second table that will automatically lookup the most recent time that each student attended a class, and then tell me how many punches they have left on their card. So, I would want the new table to show

Student Punchcard
Kim 3/5
Mary 6/10
Colleen 8/10

How am I able to look up each individual student, find the most recent date that they attended, and then have it spit out their punchcard value?

Thanks so much,
- AlbertanFireFly
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Here are two ways:


Excel 2010
ABC
1Date Student Punchcard
210-JanMary4/10
310-JanKim2/5
410-JanColleen7/10
515-JanMary5/10
615-JanKim3/5
720-JanMary6/10
820-JanColleen8/10
9
10
11
12
13Student Punchcard
14Kim3/53/5
15Mary6/106/10
16Colleen8/108/10
Sheet1
Cell Formulas
RangeFormula
C14=INDEX($C$1:$C$8,SUMPRODUCT(MAX(($B$1:$B$8=A14)*ROW($B$1:$B$8))))
B14{=INDEX($C$2:$C$8,MATCH(1,($B$2:$B$8=A14)*($A$2:$A$8=MAX(IF($B$2:$B$8=A14,$A$2:$A$8))),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Ok, that worked with the small 8 row example, but when I applied it to my 500 row sheet, it didn't. The array formula just gave me back 0s the whole way down the list. And the worksheet formula actually gave back answers like 2/5 or 8/10, but when I double checked them, they were all wrong. I tried it on my master list, which is set up as a table, then tried it without the table formatting, tried it from a separate sheet, then the same one. Always the 0s...
 
Upvote 0

Forum statistics

Threads
1,215,008
Messages
6,122,672
Members
449,091
Latest member
peppernaut

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