Formulas and blank cells

kaldrazidrim

New Member
Joined
Jan 4, 2011
Messages
15
Sorry, I'm sure it's been asked before...

I am using a time stamp in B2 to clock in, and a time stamp in C2 to clock out, and the following in D2 to calculate elapsed time:
(every time I post my formula it gets truncated) =IF(C2<b2,c2+1,c2)-b2><b2,c2+1,c2)-b2">

Here it is with spaces added so it doesn't get truncated. =IF(C2 < B2,C2+1,C2)-B2
<b2,c2+1,c2)-b2><b2,c2+1,c2)-b2><b2,c2+1,c2)-b2>
Right now when I copy this formula all the way down column D, it show zeros in each cell of column D. I need the cells in D to be (or appear) blank until there is actually data in column B and C, instead of showing zeros.

Thanks in advance, this community has been so helpful!</b2,c2+1,c2)-b2></b2,c2+1,c2)-b2></b2,c2+1,c2)-b2></b2,c2+1,c2)-b2"></b2,c2+1,c2)-b2>
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Your formula didn't post correctly because the board software interprets < as an HTML tag. Try reposting it with spaces around <
 
Upvote 0
Try

=IF(OR(B2="",C2=""),"",IF(C2< B2,C2+1,C2-B2))<b2,c2+1,c2-b2))></b2,c2+1,c2-b2))>
 
Upvote 0
Make sure that the cell is formatted as General then re-enter the formula.
 
Upvote 0
Make sure that the cell is formatted as General then re-enter the formula.
Works! Thank you so much! One more quick question. If my time stamp is within the same minute, D returns a value of 0:00. I would like it to default to a minimum elapsed time of one minute 0:01.

For example, currently B= 2:10 AM C= 2:10 AM D= 0:00

I would like it to return this: B= 2:10 AM C= 2:10 AM D= 0:01

What do you think?
 
Upvote 0
Possibly

=IF(OR(B2="",C2=""),"",MIN(IF(C2< B2,C2+1,C2-B2),1/1440))<b2,c2+1,c2-b2),1 1440))=""></b2,c2+1,c2-b2),1>
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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