Forum Discussion

dportalis_123's avatar
dportalis_123
Copper Contributor
Feb 27, 2019
Solved

Using IF function in a cell range

I have an IF function I am trying to use to sum a cell range but I am getting an error (#VALUE!). My formula is

=SUM(E5:E32)+(IF(F5:F32="_",0,E5:E32))+(E61)+(IF(F61="_",0,E61))+(E62)+(IF(F62="_",0,E62))+(E64)+(IF(F64="_",0,E64))

This is what I am trying to accomplish, I am summing cells E5:E32,E61,E62,E64 in cell E88, the if function needs to return 0, if the adjacent cells F has a value of "_" . Any suggestions would be greatly appreciated.

12 Replies

    • dportalis_123's avatar
      dportalis_123
      Copper Contributor
      Naveen, thank you, this works perfectly, solved my needs. I appreciate everyone that participated.
    • Twifoo's avatar
      Twifoo
      Silver Contributor
      I see nothing wrong with the formula. It returns no #NAME? error as you claimed earlier.
  • Twifoo's avatar
    Twifoo
    Silver Contributor
    Try this formula:
    =SUMPRODUCT(E5:E32*(F5:F32<>”_”))+
    SUMPRODUCT(E61:E62*(F61:F62<>”_”))+E64*(F64<>”_”)
      • Twifoo's avatar
        Twifoo
        Silver Contributor
        Perhaps you need to modify the values in Column F from underscore (_) to 0. Also, modify our formula by replacing underscore (_) with 0. Excel might be thinking that “_” is a defined name, so it is returning a #NAME? error.

Resources