Monday 30 September 2019

microsoft excel - Sum if ONLY all the cells have a value?


I need to sum 9 cells of data, each one on a separate sheet, but always in the same location. I only want a figure returned when all the cells have data, even if it's a 0. But, if one of the cells is blank I want a blank return.


I'm trying to get my head around, making it up actually, where the IFs and ISBLANK and SUMS would go. Any pointers would be greatly appreciated.


SUM(IF(ISBLANK(RANGEA,OR(RANGEB),0,ALLRANGES)))

Many thanks


Michael



Answer



Assuming the data is in A1 to A9:


=IF(COUNTA(A1,A2,A3,A4,A5,A6,A7,A8,A9)<9,"",SUM(A1,A2,A3,A4,A5,A6,A7,A8,A9))

And yes, this will work for cells on different sheets, even files, just change the reference, make sure you change it in both parts of the formula though.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...