Formula with IF, TODAY and MAX not working.

reberryjr

Well-known Member
Joined
Mar 16, 2017
Messages
701
Office Version
  1. 365
Platform
  1. Windows
I'm not sure why this formula isn't working. If AZ2 = "", then I want to return the value of 0. If it isn't null, I want to get the number of days between Today and the max date in column AZ.

=IF(AZ2="",0,TODAY()-(MAX(Financials!AZ:AZ)))

When I enter the formula on the Financials sheet, it works fine (obviously without the sheet reference).

Thoughts?
 
So, in thinking ahead, if the Client selects a service on 1/1/18, and then discontinues that service, but later signs up for it again on 4/1/18, I would want the formula to calculate off of the 4/1/18 date, not the 1/1/18. I'll try that formula you suggested later tonight when I get home from work.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
So, in thinking ahead, if the Client selects a service on 1/1/18, and then discontinues that service, but later signs up for it again on 4/1/18, I would want the formula to calculate off of the 4/1/18 date, not the 1/1/18. I'll try that formula you suggested later tonight when I get home from work.

Which formula are you using now?
 
Upvote 0
This one that you provided works great!
=IF(ISNUMBER(MATCH("Active",Financials!AY:AY,0)),TODAY()-MAX(Financials!AZ:AZ),0)
 
Upvote 0
So, I'm having an issue with a different formula, but the same concept. I want to see the MIN value of column K on the Stats worksheet, as long as that value is < the value in B18 on the Summaries worksheet. I have the same concept in a different column for the MAX value, and that formula works, but the MIN doesn't. Both formulas are array formulas.

For some reason, the MIN formula is cutting off at the < sign when I try to post the formula examples, even when I wrap it in code tags. The only difference between the MIN and MAX formula is that I use the less than sign instead of the greater than, and replace the word MAX with MIN.

=MIN(IF(Stats!K:K<b18,min(stats!k:k),0))< td=""></b18,min(stats!k:k),0))<>
=MAX(IF(Stats!K:K>B18,MAX(Stats!K:K),0))

<tbody>
</tbody>
 
Last edited:
Upvote 0
When posting a formua with < in it, use spaces arount it like this:

J2 < K2

By the way, it would help if you post a small sample and specify what you want to calculate using that sample.
 
Upvote 0
Yeah, I've uploaded a couple of files in the past, but my laptop started acting funny afterwards, so I'm reluctant to do so again. Essentially, I want to find the MIN value in column K of the Stats sheet, and return that value, as long as it is less than the value in cell B18 on the Summaries sheet. It works with the MAX function, but the MIN function isn't working...it keeps returning 0.

=MIN(IF(Stats!K:K < B18,MIN(Stats!K:K),0))

So, I started fiddling with the formula, and this appears to be working, but I'm not sure why the structure would be different than the MAX IF

=MIN(IF(Stats!K:K < B18,Stats!K:K,0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,559
Members
449,089
Latest member
Motoracer88

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