This should do your quest:
=MAX(IF($A$2:$A$42=A2,$C$2:$C$42-CODE(LEFT($B$2:$B$42,1))))=C2-CODE(LEFT($B2,1))
comfirmed with ctrl+shift+enter
Edit: note that criteria must be sorted alphabeticaly: CONP > DINP > INST > WARN
This should do your quest:
=MAX(IF($A$2:$A$42=A2,$C$2:$C$42-CODE(LEFT($B$2:$B$42,1))))=C2-CODE(LEFT($B2,1))
comfirmed with ctrl+shift+enter
Edit: note that criteria must be sorted alphabeticaly: CONP > DINP > INST > WARN
Last edited by zbor; 08-05-2010 at 06:05 AM.
Never use Merged Cells in Excel
Using your original sample file wherein we assume sorting data is not permitted (else we would sort by date etc) then:
it's not clear what should happen in scenarios where multiple MAX dates are located for a given contact but none of those dates has COMP action - ie which is then to be selected ?![]()
D2: =REPT("P",(MAX(IF($A$2:$A$42=$A2,$C$2:$C$42))=$C2)*OR($B2="CONP",ISNA(MATCH($A2&"@CONP@"&$C2,$A$2:$A$42&"@"&$B$2:$B$42&"@"&$C$2:$C$42,0)))) confirmed with CTRL + SHIFT + ENTER (enter alone will not suffice) copied down
the above is merely an alternative... a little long winded I grant you !
Last edited by DonkeyOte; 08-05-2010 at 06:18 AM.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks