+ Reply to Thread
Results 1 to 6 of 6

Check if Blank, If so, Check the Next Cell

Hybrid View

  1. #1
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Check if Blank, If so, Check the Next Cell

    Watterboy,

    Attached is an exammple workbook based on the criteria you provided. In Column A is the Value, Column B is the subtraction. Row 1 is headers, so data starts on row 2. Because there is no subtraction happening for the first value, cell B2 is blank. The subtraction formula starts in cell B3:
    =IF(OR(A3={"","~"}),"Null",A3-LOOKUP(2,1/(ISNUMBER($A$2:A2)),$A$2:A2))

    And is copied down. Is something like that what you were looking for?
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  2. #2
    Registered User
    Join Date
    11-29-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Check if Blank, If so, Check the Next Cell

    Quote Originally Posted by tigeravatar View Post
    Watterboy,

    Attached is an exammple workbook based on the criteria you provided. In Column A is the Value, Column B is the subtraction. Row 1 is headers, so data starts on row 2. Because there is no subtraction happening for the first value, cell B2 is blank. The subtraction formula starts in cell B3:
    =IF(OR(A3={"","~"}),"Null",A3-LOOKUP(2,1/(ISNUMBER($A$2:A2)),$A$2:A2))

    And is copied down. Is something like that what you were looking for?
    This seems to be exactly what im looking for! That is some awesome code work. Could you possibly explain how you used the LOOKUP command? I understand everything else that you did in the code, but Ive never used the LOOKUP command and I'm not understanding how it works or how you used it.

    Your method is far more elegant and effective than how I did it. I used a series of IF statements that performed checks. It was only effective up to 5 cells.

    Thanks again!
    Last edited by Watterboy; 12-08-2011 at 12:29 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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