VLOOKUP - Need formula?

Kapz786

New Member
Joined
Aug 14, 2017
Messages
2
Hi Guys

Looking to use a formula - probably VLOOKUP - My sheat is a much larger version of the below table that lists employee's first name, surname and then all the dates for a year. I then enter if someone is "A" for "Available", AM for "Available AM only" or PM for "Available PM only".

What I want to do is have a formula where I can just enter a date such as 04-07 below and it will display the 2 employee's who have listed any of A, AM or PM. Would be great if it can be done with both first name and surname (they are on 2 different columns)
First NameSurname01-0702-0703-0704-0705-0706-0707-07
JohnSmithAAMPMA
SamBlackPM
BillWhiteAAPM
JamesBlueAM

<tbody>
</tbody>
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Sorry I should say I need it to list all the employee's which could be up to 20 or so - in this example for 04-07 it is just 2 persons
 
Upvote 0
Hi, welcome to the forum.

See if you can adapt this to your set-up. The formula in L2 is a helper formula to aid efficiency - the formulas in M2 and N2 can be copied down as required.


Excel 2013/2016
ABCDEFGHIJKLMN
1First NameSurname01-Jul02-Jul03-Jul04-Jul05-Jul06-Jul07-JulDateHelper1st NameSurname
2JohnSmithAAMPMA04-Jul2JohnSmith
3SamBlackPMBillWhite
4BillWhiteAAPM
5JamesBlueAM
Sheet1
Cell Formulas
RangeFormula
L2=SUM(COUNTIF(INDEX($C$2:$I$1000,0,MATCH(K2,C1:I1,0)),{"A","AM","PM"}))
M2=IF(ROWS(M$2:M2)>$L$2,"",INDEX($A$2:$A$1000,AGGREGATE(15,6,(ROW($A$2:$A$1000)-ROW($A$2)+1)/ISNUMBER(MATCH(INDEX($C$2:$I$1000,0,MATCH($K$2,$C$1:$I$1,0)),{"AM","PM","A"},0)),ROWS(M$2:M2))))
N2=IF(ROWS(N$2:N2)>$L$2,"",INDEX($B$2:$B$1000,AGGREGATE(15,6,(ROW($B$2:$B$1000)-ROW($B$2)+1)/ISNUMBER(MATCH(INDEX($C$2:$I$1000,0,MATCH($K$2,$C$1:$I$1,0)),{"AM","PM","A"},0)),ROWS(N$2:N2))))
 
Upvote 0
Can you use something like this? Assume your data range (including headings) is A1:I5. Your formula for quantity is in C8. Your formula for Name is in D8. Your formula for surname is in E8. Make sure you take off the $ for the Column, so you can copy across and down to get your additional name and surname. Also copy down from E8 to get your next surname. For these formulas, you must use Cntrl+Shift+Enter. The formula in c8 is
=SUM(IF($C$1:$I$1=$A$8,IF($C$2:$I$5<>"",1)))

<tbody>
</tbody>
The formula for D8 is
=INDEX(A$2:A$5,SMALL(IF($C$1:$I$1=$A$8,IF($C$2:$I$5<>"",ROW($A$2:$A$5)-ROW($A$2)+1)),ROWS($D$8:D8)))

First NameSurname7/17/27/37/47/57/67/7
JohnSmithAAMPMA
SamBlackPM
BillWhiteAAPM
JamesBlueAM
DateQuantityName1Surname
7/42JohnSmith
BillWhite

<colgroup><col span="2"><col span="8"></colgroup><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,216,083
Messages
6,128,718
Members
449,465
Latest member
TAKLAM

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