# Return value based off of earliest Date and Criteria

Highlighted
Occasional Contributor

# Return value based off of earliest Date and Criteria

Hello,

I realize there may be a similar question out there but had trouble finding exactly what I was looking for so I hope someone here can help!

I am looking to return the earliest stage based off of certain criteria. In the data, I have Account data for different accounts (Column C). In Column E I have the initial Stage Date, which is the first time the Stage was set for that account.

What I'm looking for: I'm looking for the first Stage that was set on the account. For example, "Dog" was a Customer -Lost stage and I want to show that on Column F in F5 and F6. I am able to gather the initial stage date and would like to use the initial stage date and account name to inform me what the initial stage was of the account.

I hope that helps. I have attached example data here.

Thanks so much!

5 Replies
Highlighted

# Re: Return value based off of earliest Date and Criteria

@alexandrabiorka Well this is probably not what you are looking for.

But I would just a custom sort. Sort it by customer and then add a level by Date.

This will show you in order the first stage that comes up for a customer.

You could take it further if you wanted. You could then use a formula in the far right column (adding a new column) that does an if statement. If will say if the customer of the field I am on is the same as the customer on the line above, then return blank. If the customer is new, then bring in the stage. The result in this column will be it will only show the first stage name once. All the other stages should be blank.

Example:

2. Tom Jones - Customer won

3. Ed Jones - Lead - Next column says, if column 2 is Ed Jones then blank. If not then bring in intial phase of Lead. (You will have to do the If statement. I am just writing out the example).

4. Ed Jones - Customer won - Same formula. But since 3 is the same as 4 it will be blank.

Anyhow. Hope you can follow.

Highlighted

# Re: Return value based off of earliest Date and Criteria

Place this formula in F2:

=VLOOKUP(E2&C2,CHOOSE({1,2},\$B\$2:\$B\$13&\$C\$2:\$C\$13,\$D\$2:\$D\$13),2,0)

Highlighted

# Re: Return value based off of earliest Date and Criteria

Hi @Patrick2788 - thanks for your help! This unfortunately did not work for me. I am getting N/As and only Customer Closed Won. I just made sure that the date formats match as well. Please see below

Highlighted

# Re: Return value based off of earliest Date and Criteria

@TheFunOne_pdx - thanks for taking a look and helping me out! I've given it a shot but I don't think I follow. I've attached my sample dataset, would you be able to help me out by showing me an example? Thank you!

Highlighted

# Re: Return value based off of earliest Date and Criteria

What does your formula look like?