+ Reply to Thread
Results 1 to 5 of 5

Do not return a value when adjacent cell in two columns of data is empty

  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    Yellowknife, NT
    MS-Off Ver
    Excel 2003
    Posts
    15

    Do not return a value when adjacent cell in two columns of data is empty

    Hi there. I've attached an example of the problem I need to solve. I'm trying to subtract data in column A from adjacent data in column B. The problem is that where there are blank cells in column B the value returned is calculated assuming the value in column B was zero.

    Thanks very much. You have no idea how dumb I am so any help is appreciated.

    Rando
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Do not return a value when adjacent cell in two columns of data is empty

    I'm trying to subtract data in column A from adjacent data in column B
    Did you upload the correct file? Col A contains dates and column B contains values from 5.02 to 7.688 - and also there sare no blanks in B?

    hmmm maybe you meant B and C? If so, then try this....
    =IF(C2="",B2,B2-C2)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-31-2011
    Location
    Yellowknife, NT
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Do not return a value when adjacent cell in two columns of data is empty

    Quote Originally Posted by FDibbins View Post
    Did you upload the correct file? Col A contains dates and column B contains values from 5.02 to 7.688 - and also there sare no blanks in B?

    hmmm maybe you meant B and C? If so, then try this....
    =IF(C2="",B2,B2-C2)
    Yes sorry. I meant B and C (I forgot I had dates in column A). I tried your suggestion and got the same 'error'. When there's a blank cell in column C it's teated as a zero. What I'd like is that in the rows that contain blanks in column C not to return anything in column D.

    Thanks

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Do not return a value when adjacent cell in two columns of data is empty

    OK then change my formula to this...
    =IF(C2="","",B2-C2)

  5. #5
    Registered User
    Join Date
    10-31-2011
    Location
    Yellowknife, NT
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Do not return a value when adjacent cell in two columns of data is empty

    Thanks that worked.

+ 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. Look up a value from multiple columns and return an adjacent value
    By abaginska09 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-07-2013, 04:21 PM
  2. Look for adjacent non empty value along columns
    By enilegna in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-31-2013, 10:05 AM
  3. Replies: 6
    Last Post: 02-28-2013, 11:27 AM
  4. Automatically deleting empty columns and 2 adjacent
    By Sanecrazy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2011, 06:58 AM
  5. Compare values in two columns and return text from adjacent cell
    By MrBorders in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-04-2009, 04:54 AM

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