Fancy lookup required! :)

ryansm05

Board Regular
Joined
Sep 14, 2016
Messages
148
Office Version
  1. 365
Platform
  1. Windows
Hi,

I need a formula that can identify when the Employee in column A leaves the business. This can be seen from the -1 in the respective months.
For example Employee 1 leaves the business in P03. This is populated below the data and this is where I'd like the formula to work from if possible. I can adjust rows so this is not important but you can assume P01, P02, P03 etc are row1 (apologies for no attachment - company restrictions!)




Col ACol BCol CCol DCol ECol FCol GCol HCol ICol JCol KCol LCol MCol N
P01P02P03P04P05P06P07P08P09P10P11P12
AprMayJunJulAugSepOctNovDecJanFebMar
Employee 11-1
Employee 21-1
Employee 31-1
Employee 4 1-1

<colgroup><col width="64" style="width: 48pt;" span="5"><colgroup><col width="72" style="width: 54pt; mso-width-source: userset; mso-width-alt: 2560;"><colgroup><col width="64" style="width: 48pt;" span="8"><tbody>
</tbody>



Employee
Left?
Employee 1
P03
Employee 2P06
Employee 3P09
Employee 4P11

<colgroup><col width="75" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2673;"><colgroup><col width="64" style="width: 48pt;"><tbody>
</tbody>



Thanks in advance,
Ryan
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
In that case try
=IFERROR(INDEX($B$1:$M$1,MATCH(9^10,INDEX($B$3:$M$6,MATCH(A11,$A$3:$A$6,0),0),1)),"")
 
Upvote 0
In that case try
=IFERROR(INDEX($B$1:$M$1,MATCH(9^10,INDEX($B$3:$M$6,MATCH(A11,$A$3:$A$6,0),0),1)),"")

@Fluff I've tried this out but it's just returning P12 in every cell?

@jasonb75 sorry I should have clarified that this additional formula will be limited to one value per row (unlike my example for the initial formula request which had 2)

Thanks
Ryan
 
Upvote 0
The table that Fluff posted earlier has been corrupted by the forum update so I can't see the results there, but based on your data sample it should do what you need.

There could be problems however if the empty cells are not actually empty, but, for example have 0's hidden by conditional formatting.

Just in case it is an error matching it up to your actual data.

In the formula, $B$1:$M$1 should reference the top row with P01 to P12
$B$3:$M$6 should reference the whole of the top table excluding the top row and the column of names.
A11 should reference the first employee name in the second table.
$A$3:$A$6 should reference the list of employee names in the lefmost column of the top table.

Are there any merged cells in the table? They are the most well known formula killer.
 
Upvote 0
Works for me

Book1
ABCDEFGHIJKLM
1P01P02P03P04P05P06P07P08P09P10P11P12
2AprMayJunJulAugSepOctNovDecJanFebMar
3Employee 11
4Employee 2300
5Employee 311
6Employee 4 -1
7
8
9
10
11Employee 1P02
12Employee 2P05
13Employee 3P10
14Employee 4 P07
Master
Cell Formulas
RangeFormula
B11:B14B11=IFERROR(INDEX($B$1:$M$1,MATCH(9^10,INDEX($B$3:$M$6,MATCH(A11,$A$3:$A$6,0),0),1)),"")


What do you have in the blank cells?
 
Upvote 0
Works for me
What do you have in the blank cells?

I've been trying to work this out as it's definitely not working for me - and you're right, it's the blank cells!

The blank cells are showing as zero with a custom format type: #.### - so I'm basically seeing a tiny . in every blank cell.

This data comes from a corporate system that I use and so that output will not change. I guess what would be ideal would be to exclude any zeros from this formula (sorry to keep asking!)

Thanks in advance!
Ryan
 
Upvote 0
Try

=IFERROR(INDEX($B$1:$M$1,MATCH(2,1/INDEX($B$3:$M$6,MATCH(A11,$A$3:$A$6,0),0),1)),"")

This will need to be array confirmed with Ctrl Shift Enter
 
Upvote 0
Being primarily VBA based, this is beyond my formula knowledge.
 
Upvote 0
Hi Jason,

This looks to be returning the first value (P01) - I have confirmed the array with Ctrl+Shift+Enter too.
Try

=IFERROR(INDEX($B$1:$M$1,MATCH(2,1/INDEX($B$3:$M$6,MATCH(A11,$A$3:$A$6,0),0),1)),"")

This will need to be array confirmed with Ctrl Shift Enter

@jasonb75 that's incredible excel knowledge - it works! What exactly is the (2,1/INDEX doing?

@Fluff you've been super helpful so thanks again.

Thanks guys!
Ryan
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

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