samedi 14 juillet 2018

How to calculate, if any cells in a range contain a value then do a sum otherwise display nothing

I'm trying to create a formula in Excel which checks if any cell in a range of cells is empty then display nothing. If any 1 of these cells contains a value then do a sum of the cell range

e.g I have values in cells D11 to J11. In cell, L11 I am trying to calculate the sum of D11:J11 only if any 1 of my 7 cells (D11 to J11) contain a value

I have tried the following:

=IF(COUNTIF(D11:J11,""),"",SUM(D11:J11))

However, what my formula is doing currently is checking if any of my cells from D11:J11 is blank then it doesn't do the sum.

Background: I'm trying to create a timesheet invoice so if there are any hours worked in a day then L11 calculates the total amount of hours worked in a week otherwise display nothing

Any help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire