• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need to return text based on maximum date, but can't do this in 1 step

Kitty

New Member
Hi


I am trying to simplify a process which takes me multiple steps. I'm trying to find the last position a person has held.


Small Example:

Person A Junior Clerk 01-Nov-09

Person A Senior Clerk 01-Dec-11


So when I use the SUMPRODUCT(MAX) formula, I retrieve the date 01-Dec-11 which is great (thanks Chandoo!) But instead of the cell returning "01-Dec-11", I want it to say "Senior Clerk." Is there an easy way to do this in one step please?


At the moment, once I have the maximum date, I join the cells together, then do the same on my lookup table and then perform a VLOOKUP. It works, but I'm sure there must be another way!


Thanks.
 
Hi, Kitty!


First of all welcome to Chandoo's website Excel forums. Thank you for your joining us and glad to have you here.


As a starting point I'd recommend you to read the green sticky topics at this forums main page. There you'll find general guidelines about how this site and community operates (introducing yourself, posting files, netiquette rules, and so on).


Among them you're prompted to perform searches within this site before posting, because maybe your question had been answered yet.


Feel free to play with different keywords so as to be led thru a wide variety of articles and posts, and if you don't find anything that solves your problem or guides you towards a solution, you'll always be welcome back here. Tell us what you've done, consider uploading a sample file as recommended, and somebody surely will read your post and help you.


And about your question...


I have a few questions, if you don't mind. Here they are.

How is the data stored in your worksheet? In a single cell, or in three cells in the example? If in three, the date cell has a string content or an actual date with proper format? Thank you.


Regards!
 
Hi


I did do a search on this site before posting into the forum (using lots of different words) and I have now "introduced" myself. I found posts where you could return a value or a date, but not return text. Perhaps there is something that I have missed though in researching this.


The data is stored in 3 separate cells.


For example:

Person A (cell A1)

Junior Clerk ( cell B1)

(01-Nov-09) (cell C1)


The date is a proper date format. As I said, I can get around this problem by using the SUMPRODUCT (MAX) formula and then performing various lookups, but I just wondered if it would let me return text using just one formula.


Thanks
 
Hi, Kitty!


Assuming your data starts in A1 as follows:

-----

[pre]
Code:
Person A	Junior Clerk	01/11/2009
Person A	Senior Clerk	01/12/2011
Person B	Accountant	01/01/2008
Person C	Burglar		01/12/2010

Person:		Person A	Senior Clerk
[/pre]
-----

The formula for C6 cell is:

=INDICE(B1:B4;SUMAPRODUCTO((A1:A4=B6)*(C1:C4=MAX(C1:C4))*FILA(1:4))) -----> in english: =INDEX(B1:B4,SUMPRODUCT((A1:A4=B6)*(C1:C4=MAX(C1:C4))*ROW(1:4)))


Regards!
 
Hi, Kitty!


Sorry, I understood transposed. Here's the untransposed version:

-----

[pre]
Code:
Person A	Person A	Person B	Person C
Junior Clerk	Senior Clerk	Accountant	Burglar
01/11/2009	01/12/2011	01/01/2008	01/12/2010

Person:		Person A	Senior Clerk
[/pre]
-----


The formula for C5 cell is:

=INDICE(A2:D2;1;SUMAPRODUCTO((A1:D1=B5)*(A3:D3=MAX(A3:D3))*COLUMNA(A:D))) -----> in english: =INDEX(A2:D2,1,SUMPRODUCT((A1:D1=B5)*(A3:D3=MAX(A3:D3))*COLUMN(A:D)))


Just advise if any issue.


Regards
 
Hi, Kitty!

Glad you solved it. Thanks for your feedback and welcome back whenever needed or wanted.

Regards!
 
Back
Top