stop calculating

Likeexcel

Active Member
Joined
Sep 2, 2009
Messages
308
Hello:
How do I stop the formula from calculating if the date is past certain number of months?
Cell A1= 1/1/2020, Cell B1 is the current date 1/31/2022, now assume it returns zero after 12 months so in the case from 12/31/2020 on should return zero.

Below is my formula, it continues to calculate because I do not have a cap in the formula to get it to stop counting past 12 months.

=IFERROR(IF(B$1>$A1,MAX(B2-B3,0),0),0)

thank you for any suggestions!
 
Ok, if the 2 dates might be the same, leave the formula alone, if not, you can skip the 2nd test as Micron suggested:

Excel Formula:
=IF(B$1>EDATE($A1,12),0,MAX(B2-B3,0))
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

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