Dynamic formula to pull in column headers based on column values within a row

n64kps

New Member
Joined
Jun 4, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm looking to create a dynamic formula to capture an employee name if they have sales associated with a workflow. Some workflows have multiple employees with sales (some have none) and I would like to uniquely identify all employees with sales in each workflow in separate rows.

I've tried XLOOKUP, INDEX, MATCH, FILTER, etc but can't seem to get the right combination of formulas to grab the employee name and move to the next name with sales in a workflow once the first employee has been identified.

Referencing the mini-sheet below, the formula should produce the following results:
A2 = Michael
A3 = Stanley
A4 = Andy
A5 = Michael
A6 = Andy
A7 = Stanley
A8 = Angela

Allocation Example.xlsx
ABCDEFGHIJKLM
1EmployeeWorkflowWorkflowMichaelDwightJimAndyStanleyOscarAngela
2ABC123ABC1231090
3ABC123DEF456
4HIK789HIK789100
5JKL1011JKL101125252525
6JKL1011
7JKL1011
8JKL1011
Sheet1


Thank you!!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
How about this? The formula below does not depends on column B, but only the table to the right.
Book1
ABCDEFGHIJKLM
1EmployeeWorkflowWorkflowMichaelDwightJimAndyStanleyOscarAngela
2MichaelABC123ABC1231090
3StanleyABC123DEF456
4AndyHIK789HIK789100
5MichaelJKL1011JKL101125252525
6AndyJKL1011
7StanleyJKL1011
8AngelaJKL1011
Sheet4
Cell Formulas
RangeFormula
A2:B8A2=HSTACK(TOCOL(IFS(G2:M5<>"",G1:M1),2),TOCOL(IFS(G2:M5<>"",F2:F5),2))
Dynamic array formulas.
 
Upvote 1
Solution
How about this? The formula below does not depends on column B, but only the table to the right.
Book1
ABCDEFGHIJKLM
1EmployeeWorkflowWorkflowMichaelDwightJimAndyStanleyOscarAngela
2MichaelABC123ABC1231090
3StanleyABC123DEF456
4AndyHIK789HIK789100
5MichaelJKL1011JKL101125252525
6AndyJKL1011
7StanleyJKL1011
8AngelaJKL1011
Sheet4
Cell Formulas
RangeFormula
A2:B8A2=HSTACK(TOCOL(IFS(G2:M5<>"",G1:M1),2),TOCOL(IFS(G2:M5<>"",F2:F5),2))
Dynamic array formulas.
@Cubist - Yes, this works for me. Thank you so much!

I had created a formula for the workflow column but this solution negates the need for that. I was able to combine sales sets from multiple tables and use VSTACK to make one consolidated table.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

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