2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Correction on formula using sum and max to negate negative number

Our take

To calculate only positive excess hours in your spreadsheet, you'll want to adjust your formula to handle empty cells and prevent negative results. Try using the following formula in cell G61: `=IF(AND(F61<>"", C61<>""), MAX(0, (F61 - C61) - (E61 - D61)), "")` This formula checks if both F61 and C61 have values. If they do, it calculates the excess hours while ensuring the result is non-negative. If either cell is empty, G61 will remain blank, avoiding any confusion with negative

I'm trying to input an hour's punch as I'm a manager and I'm not punching my hours officially, but i want to calculate the excess hours.

I need help with writting a formula to only have postive number, no negative.

Here is the formula I'm trying to enter, but having error alert

=Sum(max((0;(f61-c61))-(e61-d61)))

currently having

=SUM(F60-C60)-(E60-D60)

i need help to correct my formula for only showing the result of it, and not the absence of result like now in the cell G61 as the cell F61 is empty.

I would like the G61 only showing a result if both cell are completed. Thats why i dont want a neg number in G61 and inputing a 0 if the result of the formula is negative...

I don't want a negative number on my g column cells.

What would be the correct formula?

a b c d e f g
date start break end break end Total
2026-04-14 5.5 15.25 9.75
2026-04-15 5.5 15 9.5
61 2026-04-16 5.5 -5.5
2026-04-17 0

Here's a sample of the table im working with.

Thanks

submitted by /u/quebecoisbarbu
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article