View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default AVG or Return 1 value from either of 2 cells if one is blank

Hi,

It's irrelevant where the data are coming from. If your formula works well
then put my formula alongside yours is a cell and try and make them give
different answers and you'll fail to do so because they will always return
the same one. Including #DIV/0 of both cells are empty.

You asked for a simpler way and as of yet the one I posted is the simplest
and meets all of the requirements


Best regards,

Mike

"Diddy" wrote:

Hi Mike,

Sorry Mike, I've misled you! The data is coming in from worksheets prepared
by different people from a database. I've no control over what is put in the
db fields, so in some cases the missing data may be left blank or may be a
zero.

The formula I have does work but I wondered if there was a more efficient way.

Cheers
--
Diddy


"Mike H" wrote:

Hi,

Average ignores blanks cell so

=AVERAGE(E8,H8)

does what you want.

Mike

"Diddy" wrote:

Hi everyone,

I'm using the following formula to average the values of 2 cells. If either
is empty, I want it to return the value in the non-blank cell.

=IF(AND(E80,H80),AVERAGE(E8,H8),SUM(E8,H8))

This works fine but is there a better way to do it?

Cheers
--
Diddy