Share via

#Value! error message on blank cells

Anonymous
2010-09-22T17:19:37+00:00

I have a formula that takes two cells and multiplies them then adds this product to two more cells that are multiplied, etc etc etc about 27 times. (i.e. A1*B1+A3*B3+A5*B5...) The cells are all number formatted, but these cells contain formulas that would return a blank ("") if certain conditions are not met.  Since some of the cells are blank, excell returns the #Value! error.  I wanted to keep the blanks, rather than 0s for esthetic reasons, since this is a large spreadsheet. Might there be a way to do this?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-09-22T17:34:25+00:00

I have a formula that takes two cells and multiplies them then adds this product to two more cells that are multiplied, etc etc etc about 27 times. (i.e. A1*B1+A3*B3+A5*B5...) The cells are all number formatted, but these cells contain formulas that would return a blank ("") if certain conditions are not met.  Since some of the cells are blank, excell returns the #Value! error.  I wanted to keep the blanks, rather than 0s for esthetic reasons, since this is a large spreadsheet. Might there be a way to do this?

Try this...

=SUMPRODUCT(--(MOD(ROW(A1:A5)-ROW(A1),2)=0),--(ISNUMBER(A1:A5)),A1:A5,--(ISNUMBER(B1:B5)),B1:B5)

--

Biff

Microsoft Excel MVP

Actually, we don't need the ISNUMBER tests:

=SUMPRODUCT(--(MOD(ROW(A1:A5)-ROW(A1),2)=0),A1:A5,B1:B5)

--

Biff

Microsoft Excel MVP

Was this answer helpful?

0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-09-22T17:56:51+00:00

    Actually, we don't need the ISNUMBER tests:

    =SUMPRODUCT(--(MOD(ROW(A1:A5)-ROW(A1),2)=0),A1:A5,B1:B5)

    You don't really need the subtraction either...

    =SUMPRODUCT(--(MOD(ROW(A1:A5),2)=1),A1:A5,B1:B5)

    The row subtraction is to make the formula more robust against row insertions.

    Try that version and then insert a new row 1. The MOD test now fails in relation to the data range.

    It's simple and doesn't add any undue complexity or inefficiency to the formula so I always include it.

    If you know for certain that you will never insert new rows before the range then you can eliminate that test.

    --

    Biff

    Microsoft Excel MVP

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2010-09-22T17:44:19+00:00

    Actually, we don't need the ISNUMBER tests:

    =SUMPRODUCT(--(MOD(ROW(A1:A5)-ROW(A1),2)=0),A1:A5,B1:B5)

    You don't really need the subtraction either...

    =SUMPRODUCT(--(MOD(ROW(A1:A5),2)=1),A1:A5,B1:B5)


    NOTE: Please mark the message or messages (yes, you can mark more than one) that answer your question as the "Answer" so that others will know your question has been resolved.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2010-09-22T17:34:05+00:00

    Sumproduct treats blanks and zero length strings returned by formulas as 0, already, so there's no need for the ISNUMBER functions.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2010-09-22T17:31:30+00:00

    I have a formula that takes two cells and multiplies them then adds this product to two more cells that are multiplied, etc etc etc about 27 times. (i.e. A1*B1+A3*B3+A5*B5...) The cells are all number formatted, but these cells contain formulas that would return a blank ("") if certain conditions are not met.  Since some of the cells are blank, excell returns the #Value! error.  I wanted to keep the blanks, rather than 0s for esthetic reasons, since this is a large spreadsheet. Might there be a way to do this?

    Try this...

    =SUMPRODUCT(--(MOD(ROW(A1:A5)-ROW(A1),2)=0),--(ISNUMBER(A1:A5)),A1:A5,--(ISNUMBER(B1:B5)),B1:B5)

    --

    Biff

    Microsoft Excel MVP

    Was this answer helpful?

    0 comments No comments