Ignore Text in a Multi Sum Formula

Dkendr02

New Member
Joined
Feb 27, 2018
Messages
8
I am trying to calculate the total # of hours of operation using the formula below where each value is a time. If one of the values is text - "Closed" - i get a #VALUE! error. I tried turning it into a SUM formula but I get the same error.
What do i need to change in order to return a value that completes the calculation but ignores the text? Note that 'closed' could appear multiple times in any cell.

=((J44-I44)+(L44-K44)+(N44-M44)+(P44-O44)+(R44-Q44)+(T44-S44)+(V44-U44))

or

=((8am-4pm)+(8am-4pm)+(8am-4pm)+(8am-4pm)+(8am-4pm)+(8am-4pm)+(CLOSED-CLOSED))
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try:

Excel Formula:
=((N(J44)-N(I44))+(N(L44)-N(K44))+(N(N44)-N(M44))+(N(P44)-N(O44))+(N(R44)-N(Q44))+(N(T44)-N(S44))+(N(V44)-N(U44)))
 
Upvote 0
=((N(J44)-N(I44))+(N(L44)-N(K44))+(N(N44)-N(M44))+(N(P44)-N(O44))+(N(R44)-N(Q44))+(N(T44)-N(S44))+(N(V44)-N(U44)))
This does return a value but it is overstated....the facility i am working on is open 10am-6pm Monday thru Saturday, closed on Sunday. The correct value for this should be 48 (8hrs X 6 days). When I use this formula, it returns the value "68".
1677169347642.png
 
Upvote 0
The result of the N function is the serial number of the hours, now you must multiply it by 24 to have the total in hours:

Dante Amor
AHIJKLMNOPQRSTUV
42MONDAYTUESDAYWEDNESDAYTHURSDAYFRIDAYSATURDAYSUNDAY
43HrsOpenCloseOpenCloseOpenCloseOpenCloseOpenCloseOpenCloseOpenClose
444810:00 a. m.06:00 p. m.10:00 a. m.06:00 p. m.10:00 a. m.06:00 p. m.10:00 a. m.06:00 p. m.10:00 a. m.06:00 p. m.10:00 a. m.06:00 p. m.CLOSEDCLOSED
Hoja2
Cell Formulas
RangeFormula
H44H44=((N(J44)-N(I44))+(N(L44)-N(K44))+(N(N44)-N(M44))+(N(P44)-N(O44))+(N(R44)-N(Q44))+(N(T44)-N(S44))+(N(V44)-N(U44)))*24
 
Upvote 0
Solution
=((N(J44)-N(I44))+(N(L44)-N(K44))+(N(N44)-N(M44))+(N(P44)-N(O44))+(N(R44)-N(Q44))+(N(T44)-N(S44))+(N(V44)-N(U44)))*24

I am still getting 68....are your "06:00 p.m." values being treated differently than mine?

1677172913669.png
 

Attachments

  • 1677172870185.png
    1677172870185.png
    20.7 KB · Views: 3
Upvote 0
Your formula points to cells in row 44, in your image I only see row 41.
In my example the formula is for the cells of row 44 and the result is correct: 48 hours.

1677173295870.png
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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