Getting the last value when conditions are met

chuchuberthelot

New Member
Joined
Mar 2, 2020
Messages
2
Platform
  1. MacOS
Hi I'm trying to get the last value when the following conditions are met.

  1. Customer ID = Customer ID
  2. Date 1 < Date 2
Value Returned is what I want to have.

I've tried this formula, but it doesn't seem to work...

=IF(AND(E2=$A$2:$A$13,B2:B13<F2),$C$2:$C$13)

Can anyone help me?
 

Attachments

  • sample.PNG
    sample.PNG
    18.1 KB · Views: 7

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=INDEX($C$2:$C$20,AGGREGATE(14,6,(ROW($C$2:$C$20)-ROW($C$2)+1)/($A$2:$A$20=E2)/($B$2:$B$20<=F2),1))
 
Upvote 0
This should do it.
Excel Formula:
=LOOKUP(2,1/($A$2:$A$20=E2)/($B$2:$B$20<=F2),$C$2:$C$20)
Note that this will return the last in the list that meets the criteria, not the most recent date if the sort order is changed.
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

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