LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default If statement with time

A late idea came to my mind: if you temporarily format the cells like
hh:mm:ss then seconds not equaling zero would at once point to the rounding
issue.

Thanks for the feedback!
Stefi


€žsaltnsnails€ť ezt Ă*rta:

I have it figured out. It did return the correct value on certain time
frames but not on others. I think it was b/c of the rounding issue. Some of
the figures came back 30.0000000000001000 etc when I expanded the decimals.
Thanks!
--
-CRM


"Stefi" wrote:

I tested your example and =if(c7=30, 0, 1) gave 0 for me (in Excel 2003).

You might check again your data and formats.

Stefi

€žsaltnsnails€ť ezt Ă*rta:

My formula to calculate time in cell C7 looks like this:
=IF(B70,(B7-A7)*1440,0)

A7 and B7 are formatted for am/pm time. C7 is formatted for number. I
have 9:00 am in A7 and 9:30 am in B7. It calculates 30. When I ask the if
statement to return a 0 when the statement is true, it returns it as false
instead with a 1.

Hope that makes sense.
--
-CRM


"David Biddulph" wrote:

Is the C7 cell calculating a number of minutes, or is it a time in Excel
format? What is your formula, and what are the input values to the formula?

What value do you see in C7 if you temporarily change the format from time
to General or Number?

Also, are you sure that the time calculated is exactly 30 minutes, or might
it be 29.9999999 or 30.000001? You may wish to include a ROUND function in
your criterion.
--
David Biddulph


"saltnsnails" wrote in message
...
Stefi,
Thanks for the reply. I inputed that formula but it is still returning a
1
when the calculated time cell equals 30.
--
-CRM


"Stefi" wrote:

Try
=IF(MINUTE(C7)=30,0,1)

Regards,
Stefi

"saltnsnails" ezt Ă*rta:

I have a formula that calculates time. It works well. I am trying to
have
another formula return a value based on time calculated. If a cell
equals 30
minutes I want the formula to return a value of 0. If it does not
equal 30,
I would like a value of 1. So I have entered =if(c7=30, 0, 1). C7
refers to
the cell where the time is calculated. I entered time data and the
time
calculates a 30 but the other formula is returning a 1. Any thoughts?
--
-CRM



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If statement to compare time cell to a time Z-Man-Cek Excel Worksheet Functions 16 July 29th 16 08:17 AM
using if statement to subtract 24 hours from time still shows as a negative time from both responses under 24 hours richard.littlewing Excel Worksheet Functions 2 September 15th 08 08:05 AM
If statement for time Dom Excel Discussion (Misc queries) 0 June 10th 08 11:38 AM
if then statement = time jstaggs[_2_] Excel Worksheet Functions 2 May 1st 07 09:12 PM
IF statement to calculate time usage in specific time bands Daren Excel Worksheet Functions 6 January 31st 07 01:34 PM


All times are GMT +1. The time now is 09:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"