Ignore text in formula

sw101

New Member
Joined
Jan 30, 2019
Messages
3
Need to sum and multiply in a time sheet style formula and ignore text

=SUM((K26-H26)+(I26-J26))*24

Columns are Time In, Time Out, Break in, Break Out

I'd like to put either a - or n/a if they do not take a break and then sum their hours.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Welcome to the Board.

Try:

=((K26-H26)+(N(I26)-N(J26)))*24

or

=((K26-H26)+IFERROR(I26-J26,0))*24


Note that the SUM is not needed in this case.
 
Last edited:
Upvote 0
Which formula did you use, and what values do you have in K26, H26, I26 and J26?
 
Upvote 0
I tried both. No error message initially (when I left the break in/break out cells blank) but when I put any text into it, it then returned that error.

K26 -
H26 13:00
I26 17:00
J26 -
 
Upvote 0
Sorry, I misunderstood which fields belonged to Time In/Out Break In/Out. Try:

=(I26-H26-IFERROR(K26-J26,0))*24
 
Upvote 0
maybe: =SUM(K26,-N(H26),SUM(I26,-N(J26))*24)

adapt to your needs (I don't know where could be "-" , randomly? )
 
Upvote 0

Forum statistics

Threads
1,216,111
Messages
6,128,899
Members
449,477
Latest member
panjongshing

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