Time-Defined IF Statement Does Not Update

arnpry

New Member
Joined
Jun 29, 2015
Messages
8
I have a formula that I've been trying to setup that reads a data value from the 4th row of the N Column IF the current time is less than 5:00am, ELSE pull from the 2nd row of the column.
Code:
<code>=IF(T2<"5",N4,N2)</code>
Formula for Current Time (Hour) in Cell T2:
Code:
<code>=TEXT(NOW(),"H")</code>
The purpose of this IF statement is to account for using old temperature data until 5am, when the new data comes in. I thought that I had this formula set up correctly but, for the past few mornings, it has not worked.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
If you want to do a numerical comparison on an hour, then don't use text.

=VALUE(TEXT(NOW(),"H"))
... and don't have the "5" in quotes.

Someone has already given a good alternative anyway.
 
Upvote 0
I removed the double quotes from around 5 to see if that will make it work or not... Will be checking back tomorrow morning before 5am to see if this fix worked or not...
 
Upvote 0
I removed the double quotes from around 5 to see if that will make it work or not... Will be checking back tomorrow morning before 5am to see if this fix worked or not...
... as long as you also changed the formula.
 
Upvote 0
Your formula in T2 is returning a TEXT string...because of the function called....TEXT.

So your comparison of The TEXT value "5" in T2, to the NUMBER 5 is invalid.
You need to convert the TEXT string in T2 to a real number.

Try

=IF(T2+0<5,N4,N2)


Or change the formula in T2 as suggeted by Glenn in Post #3
 
Upvote 0
Of course! That makes sense now... The formula is trying to reference back to a number but, it's formatted as text... :rolleyes:

Your formula in T2 is returning a TEXT string...because of the function called....TEXT.

So your comparison of The TEXT value "5" in T2, to the NUMBER 5 is invalid.
You need to convert the TEXT string in T2 to a real number.

Try

=IF(T2+0<5,N4,N2)


Or change the formula in T2 as suggeted by Glenn in Post #3
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,582
Members
449,039
Latest member
Arbind kumar

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