Find and Return Multiple Values Across Row and Column Data

monicamarie

Board Regular
Joined
Sep 2, 2008
Messages
72
Office Version
  1. 365
I have a workbook that tracks time off for employees. There are 3 types of time off: V, P and NP. (Vacation, Personal and No Pay) The worksheet lists the days of the week across the top as column headers and the names are entered in Columns A (Last Name) and B (First Name) going down. Say an employee wants a list of all the days they took off for the year; I want to find a way to pull the data together in a separate worksheet so that it looks like the result below. I can't seem to find a solution to this but I know it must be possible. Any help would be greatly appreciated.

Sample section of worksheet
Last NameFirst NamePTOPersonalNo Pay1/11/21/31/41/5
AveryMichelle000
BrownAlyssa000
ChaseLinda00.50P (4)
LettAndrew000
MarinoDaniel000
MatthewsKen0.50.50P(4)&V(4)
MichaelsonMelinda210VVNPP
SmithMike101VNP

Say for example I want to give Melinda a list of days that she did not work. This is the desired result:

DateTime Off Type
1/2V
1/3V
1/4NP
1/5P
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Power Query solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Last Name", "First Name"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Attribute] <> "No Pay" and [Attribute] <> "Personal" and [Attribute] <> "PTO") and ([Last Name] = "Michaelson"))
in
    #"Filtered Rows"

Book1
ABCDEFGHIJ
1Last NameFirst NamePTOPersonalNo Pay1-Jan2-Jan3-Jan4-Jan5-Jan
2AveryMichelle000
3BrownAlyssa000
4ChaseLinda00.50P (4)
5LettAndrew000
6MarinoDaniel000
7MatthewsKen0.50.50P(4)&V(4)
8MichaelsonMelinda210VVNPP
9SmithMike101VNP
10
11
12Last NameFirst NameAttributeValue
13MichaelsonMelinda2-JanV
14MichaelsonMelinda3-JanV
15MichaelsonMelinda4-JanNP
16MichaelsonMelinda5-JanP
17
Sheet1
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Sorry. I should have mentioned that. I am using Excel 360. I updated that in my account details. Thanks for the reminder.
 
Upvote 0
Thanks for that.
How about
++Fluff.xlsm
ABCDEFGHIJKLMN
1Last NameFirst NamePTOPersonalNo Pay01-Jan01-Feb01-Mar01-Apr01-May
2AveryMichelle000Melinda01/02/2022V
3BrownAlyssa000Michaelson01/03/2022V
4ChaseLinda00.50P (4)01/04/2022NP
5LettAndrew00001/05/2022P
6MarinoDaniel000
7MatthewsKen0.50.50P(4)&V(4)
8MichaelsonMelinda210VVNPP
9SmithMike101VNP
10
Data
Cell Formulas
RangeFormula
M2:N5M2=LET(f,TRANSPOSE(FILTER(F1:J9,(B1:B9=L2)*(A1:A9=L3)+(ROW(A1:A9)=1))),FILTER(f,INDEX(f,,2)<>0))
Dynamic array formulas.
 
Upvote 0
Thanks for that.
How about
++Fluff.xlsm
ABCDEFGHIJKLMN
1Last NameFirst NamePTOPersonalNo Pay01-Jan01-Feb01-Mar01-Apr01-May
2AveryMichelle000Melinda01/02/2022V
3BrownAlyssa000Michaelson01/03/2022V
4ChaseLinda00.50P (4)01/04/2022NP
5LettAndrew00001/05/2022P
6MarinoDaniel000
7MatthewsKen0.50.50P(4)&V(4)
8MichaelsonMelinda210VVNPP
9SmithMike101VNP
10
Data
Cell Formulas
RangeFormula
M2:N5M2=LET(f,TRANSPOSE(FILTER(F1:J9,(B1:B9=L2)*(A1:A9=L3)+(ROW(A1:A9)=1))),FILTER(f,INDEX(f,,2)<>0))
Dynamic array formulas.
Wow, this works beautifully! I would not have been able to come up with such a complex formula so thank you very much for your help.
 
Upvote 0
Power Query solution

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Last Name", "First Name"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Attribute] <> "No Pay" and [Attribute] <> "Personal" and [Attribute] <> "PTO") and ([Last Name] = "Michaelson"))
in
    #"Filtered Rows"

Book1
ABCDEFGHIJ
1Last NameFirst NamePTOPersonalNo Pay1-Jan2-Jan3-Jan4-Jan5-Jan
2AveryMichelle000
3BrownAlyssa000
4ChaseLinda00.50P (4)
5LettAndrew000
6MarinoDaniel000
7MatthewsKen0.50.50P(4)&V(4)
8MichaelsonMelinda210VVNPP
9SmithMike101VNP
10
11
12Last NameFirst NameAttributeValue
13MichaelsonMelinda2-JanV
14MichaelsonMelinda3-JanV
15MichaelsonMelinda4-JanNP
16MichaelsonMelinda5-JanP
17
Sheet1
This looks great. I just need to train myself on power queries. Thank you so much.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,954
Messages
6,175,603
Members
452,658
Latest member
GStorm

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