Formula help - last date in a range with criterion

virtuosok

Board Regular
Joined
Sep 2, 2020
Messages
209
Office Version
  1. 365
Platform
  1. Windows
Hi,
I am likely missing something very obvious... can you tell me what is wrong with the formula as it currently stands? I am trying for it to return the last date with 1 criterion.
Here's the source tab:
Capture.PNG


...and here's the tab with the formula in cell O10; I expect it to return the value from cell N3 above, i.e. 10 Jan 2020 but it returns zero:

tempsnip.png
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Shouldn't it be returning N8 rather than N3?
The values in col A are left aligned, which suggest they are text & not numbers, if that is the case, is col B also text?
 
Upvote 0
Indeed this should be N8 rather than N3, that's why I need formulas :)
Thanks for pointing me in the right direction.
I am also trying a regular formula (versus array formula), and this one seems to work well:
=MAX(INDEX((Prescreening!B10=IWRS002!$A$2:$A$3000)*IWRS002!$N$2:$N$3000,))
However is it possible for it to return an empty string, if there are no matches? It returns zero which is auto-formatted to 1/0/1900
 
Upvote 0
How about
Excel Formula:
=IFERROR(1/(1/MAX(INDEX((B10=IWRS002!$A$2:$A$3000)*IWRS002!$N$2:$N$3000,))),"")
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
So we sorted the "last date", now what about the first date in the range?
If I just change this formula
=IFERROR(1/(1/MAX(INDEX((B10=IWRS002!$A$2:$A$3000)*IWRS002!$N$2:$N$3000,))),"")
with
=IFERROR(1/(1/MIN(INDEX((B10=IWRS002!$A$2:$A$3000)*IWRS002!$N$2:$N$3000,))),"")
...it doesn't work. What else should I tweak?
 
Upvote 0
How about
Excel Formula:
=IFERROR(1/(1/MIN(IF(B10=IWRS002!$A$2:$A$3000, IWRS002!$N$2:$N$3000,10^10))),"")
needs CSE entry
 
Upvote 0
Interesting enough, the MAX formula works both with CSE and without CSE, but the MIN one does not... any other ideas please?
 
Upvote 0
That's why I said it needs CSE entry. ;)
What is wrong with the MIN formula I provided?
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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