PDA

View Full Version : Get TIME format to match?



RINCONPAUL
04-25-2016, 08:49 PM
I've got two cells A28 & 29, one has formula "=TIME(MID(A2,FIND(":",A2)-2,2),MID(A2,FIND(":",A2)+1,2),0)" which strips out the time from a text string in another cell. It reads as say 1:42 PM.

In another cell A29, I have "=NOW()" currently showing 1:42 PM.

A third cell asks "=IF(A28=A29,"YES","")". They don't yield a "YES" condition! How do I get round this, as the "YES" condition triggers a macro.

Cheers

snb
04-26-2016, 03:50 AM
What is the result of =timevalue(A2) instead of that long formula ?

RINCONPAUL
04-26-2016, 04:13 AM
What is the result of =timevalue(A2) instead of that long formula ?

#VALUE!....snb


A typical entry for cell A2:

PBarr 26th Apr - 21:12 A4 480m

Paul_Hossler
04-26-2016, 05:31 AM
In A29 try

=TEXT(NOW(),"h:mm AM/PM")

SamT
04-26-2016, 07:43 AM
In another cell A29, I have "=NOW()" currently showing 1:42 PM.
It may be displaying 1:42 PM, but that is not its value. Its value is something like "42486.3948208333," (9:28:33 AM today.) A28 will never = A29.


Even "=IF(Text(A28)=Text(A29),"YES","")" will only be true for one minute.


Try TimeValue(A29)>=TimeValue(A28)

RINCONPAUL
04-26-2016, 02:05 PM
Sorry guys, just woke up. Thanks for your great responses as always. You were on the right track, as "=TEXT(A28,"h:mm AM/PM") in cells A31 & A32 did the trick!

I've attached a mockup. There is a macro called Copy_Race that fires when A30 = "YES" and this copies and pastes a Range from sheet BOT to Sheet1. That works great now. Only thing, and I'll have to wait till the races start to find out, is sheet BOT looks at sheet GRUSS which is a continually updating Racing program, So prices and race descriptions are updated every second. Will that fire this, as at the moment I have to press F9 to update the NOW() cell? Should be OK, I hope.

You're all the best, thanks.