+ Reply to Thread
Results 1 to 8 of 8

Summing Cells that contain an IF Statement to leave the cell blank if zero

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    Rhode Island, United States
    MS-Off Ver
    Excel 2003
    Posts
    12

    Summing Cells that contain an IF Statement to leave the cell blank if zero

    I need to sum cells that contain this formula: =if($c$5=0,"",c5*b5). I am getting a wrong data type value error.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Summing Cells that contain an IF Statement to leave the cell blank if zero

    whats in c5 or d5
    it would appear to be text
    are you sure there are numbers there ?

    try

    =ISTEXT(C5)
    =ISTEXT(B5)
    or
    ISNUMBER(C5)
    ISNUMBER(B5)

    if it is a number but has been formatted or imported as text , a few things you could do is

    1) multiply by 1
    2) Add 0
    3) use data> text to columns > delimited > next >next - will turn text numbers to numbers, for the whole column - if an imported list

    =if($c$5*1=0,"",(c5*1)*(b5*1))
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    03-12-2014
    Location
    Rhode Island, United States
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Summing Cells that contain an IF Statement to leave the cell blank if zero

    This if statement will leave the cell blank if there is a zero value, otherwise it will calculate the formula. When it is left blank it is read as "". I need to include these cells in sum for future use.

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Summing Cells that contain an IF Statement to leave the cell blank if zero

    =if( OR( C5=0, C5="") ,"",c5*b5)

    so now if the cell C5 is blank or zero - you will get a blank returned
    you could also test for B5

    =if( OR( C5 = 0, C5 = "" , B5 = "" ) ,"",c5*b5)

    you have $ around the cell - did you want to fix C5 regardless of where you copy the formula?

  5. #5
    Registered User
    Join Date
    03-12-2014
    Location
    Rhode Island, United States
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Summing Cells that contain an IF Statement to leave the cell blank if zero

    The original formula is correct, it returns a blank if the value is zero. I am trying to total some values (=c5+c8+c11+c13) and because the cells have a blank in them the formula will not sum them.

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Summing Cells that contain an IF Statement to leave the cell blank if zero

    instead of using
    + use sum as that will ignore the blanks

    =sum(c5,c8,c11,c13)

  7. #7
    Registered User
    Join Date
    03-12-2014
    Location
    Rhode Island, United States
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Summing Cells that contain an IF Statement to leave the cell blank if zero

    Ahhhhh that's it. Thank you Sorry I wasn't clear in the beginning!! Have a great weekend.

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,739

    Re: Summing Cells that contain an IF Statement to leave the cell blank if zero

    your welcome, thanks for the rep

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. IF Statement to leave cell blank if multiple cells are all blank
    By sweeteri in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-14-2014, 12:02 PM
  2. MS 2010 - IF Statement to reutrn date or leave cell blank
    By persais in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 03-14-2013, 02:48 PM
  3. Replies: 3
    Last Post: 01-31-2013, 02:03 PM
  4. IF Statement to leave cell completely blank
    By david1987 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-28-2012, 10:27 AM
  5. Replies: 4
    Last Post: 07-15-2008, 01:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1