Adding times but ignoring text.

RollieMillan

New Member
Joined
Mar 23, 2016
Messages
2
Hi, I'm trying to find a formula that will add different times but ignore cells when text instead of time is typed on the cell. Here is an example of what I'm trying to do and the formula I'm currently using (which works until text is replacing time):

[K] [L] [N] [O] [Q] [R] [T] [W] [X] [Z]
MONDAY TUESDAY WEDNESDAY THURSDAY FRIDAY TOTAL HRS
In Out In Out In Out In Out In Out
5:00 AM 2:00 PM 5:00 AM 12:00 PM 5:00 AM 4:00 PM OFF OFF 5:00 AM 1:30 PM _________

Formula used: =SUM((L3-K3)*24)+((O3-N3)*24)+((R3-Q3)*24)+((U3-T3)*24)+((X3-W3)*24)

I was privileged to keep track of the times and days off of 500+ employees, so I'm trying to make my life as easy as possible. Thank you in advance for your help.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
don't put the *24 in each calc, do it at the end...
=((L3-K3)+(O3-N3)+(R3-Q3)+(U3-T3)+(X3-W3))*24
 
Upvote 0
Hi,

I think this will work for you, use formula in Z5:


Excel 2010
KLNOQRTUWXYZ
35:00 AM2:00 PM5:00 AM12:00 PM5:00 AM4:00 PMOFFOFF5:00 AM1:30 PM#VALUE!
4#VALUE!
535.5
Sheet1
Cell Formulas
RangeFormula
Z3=SUM((L3-K3)*24)+((O3-N3)*24)+((R3-Q3)*24)+((U3-T3)*24)+((X3-W3)*24)
Z4=((L3-K3)+(O3-N3)+(R3-Q3)+(U3-T3)+(X3-W3))*24
Z5=(IFERROR(L3-K3,0)+IFERROR(O3-N3,0)+IFERROR(R3-Q3,0)+IFERROR(U3-T3,0)+IFERROR(X3-W3,0))*24
 
Upvote 0
Or

=(SUM(L3,O3,R3,U3,X3) - SUM(K3,N3,Q3,T3,W3))*24
 
Last edited:
Upvote 0
Using JT/s sample, I can see that mine did not work, but shg's did and is far simpler :)
 
Upvote 0
GENIUS, pure Genius. This worked perfectly. Thank you so much JTAKW. :)

You're welcome, welcome to the forum, just realized you're not far from me, (couple hours drive).

I agree, shg's formula is a more elegant solution, check it out.

I actually started constructing my formula in that same manner, but must have messed something up, and it didn't work the way I wrote it, so I provided the formula in post #3, but again, I recommend shg's formula.
 
Upvote 0
Given that you have column headings, you could also use those to get the sums. Whilst this is slightly longer than shg's & it seems your data is just 5 days, this would also allow easy expansion to a bigger range without targeting individual cells/columns.

Excel Workbook
KLMNOPQRSTUVWXYZ
2InOutInOutInOutInOutInOut
35:00 AM2:00 PM5:00 AM12:00 PM5:00 AM4:00 PMOFFOFF5:00 AM1:30 PM35.5
Sheet4
 
Upvote 0

Forum statistics

Threads
1,213,558
Messages
6,114,297
Members
448,564
Latest member
ED38

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