Stop formula from calculating if criteria is meet and keep the last data of formula calc.

vivis93

New Member
Joined
Sep 12, 2015
Messages
21
Hi i have this formula in my cell
Code:
[COLOR=#333333]=FILTERXML(WEBSERVICE("http://api.openweathermap.org/data/2.5/forecast/daily?q="&AE1121&"&mode=xml&units=metric&cnt=14appid=bd82977b86bf27fb59a04b61b657fb6f");"/weatherdata/forecast/time[@day='"&TEXT(N1119;"YYYY-MM-DD")&"']/"&AC1126&"/@"&AD1126)[/COLOR]


I want to stop the formula from calculating if the date in cell N1119<Today(), also the data calculated not to change to remain the last value, eg in the cell N1119 the date is 2015-10-14 and the formula gives to me the temperature 15 C the next day the formula to stop and to not update automatically, because i use an api when excel refresh automatically and if the day that i search is passed it gives to me 0 eg. if today is 2015-10-15 the formula will give 0 for response,
I use this formula in different cells.

Any help
 
So if N is less than today's date, you want it to proceed as if N was equal to today ?

Try changing this part
TEXT(N1;"YYYY-MM-DD")
to
TEXT(MAX(TODAY(),N1);"YYYY-MM-DD")
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Upvote 0
ok thank you very much for trying to help yaeah thats all i need i hope some one will help all the best
 
Upvote 0
If that was a correct assessment, then that's what my suggestion will do.

MAX(TODAY(),N1)

If N1 is less than today, it will use Today's date.
If N1 is today or in the future, it will use N1.

I hadn't noticed that your formula has ; instead of , as seperators.
So you would need to change that , to a ;
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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