Results 1 to 4 of 4

SUM range ONLY if adjacent cell is not BLANK

This is a discussion on SUM range ONLY if adjacent cell is not BLANK within the Excel Questions forums, part of the Question Forums category; Greetings. I have two columns of data. I want to sum up one column of numbers ONLY if the next ...

  1. #1
    New Member
    Join Date
    Apr 2004
    Posts
    33

    Default SUM range ONLY if adjacent cell is not BLANK

    Greetings. I have two columns of data. I want to sum up one column of numbers ONLY if the next to each number there is text in the column. If a number has no text in the adjacent cell, I want to ignore that cell's number in the total sum. Should I use SUMIF, and if so, how? Thanks!

  2. #2
    Board Regular schielrn's Avatar
    Join Date
    Apr 2007
    Location
    Cincinnati, Ohio
    Posts
    6,924

    Default Re: SUM range ONLY if adjacent cell is not BLANK

    Try this where column B contains the values to sum and column A contains the cells that are text:

    =Sumif(A:A,"<>"&"",B:B)

    If you want it to be text and not numeric either then try:

    =SUM(IF(ISTEXT(A1:A100),B1:B100,0))

    Confirmed with control+shift+enter and not just enter.

    Change column references as necessary. Hope that helps.
    Last edited by schielrn; Mar 6th, 2008 at 07:29 PM.
    Always make a back up copy before trying new code, you never know what you might lose!


    - Posting guidelines, forum rules and terms of use

    -Try searching for your answer first, see how

    - Read the FAQs

    - List of BB codes

    "The world suffers a lot. Not because of the violence of bad people, but because of the silence of good people!"

  3. #3
    MrExcel MVP
    Moderator
    barry houdini's Avatar
    Join Date
    Mar 2005
    Location
    England
    Posts
    19,945

    Default Re: SUM range ONLY if adjacent cell is not BLANK

    Possibly

    =SUMIF(A:A,"<>",B:B)

  4. #4
    New Member
    Join Date
    Apr 2004
    Posts
    33

    Default Re: SUM range ONLY if adjacent cell is not BLANK

    Thank you both! That works like a champ. I actually tried the "<>" trick and couldn't get it to work. It works fine now. Thanks!

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com