Results 1 to 6 of 6

Check if Blank, If so, Check the Next Cell

Threaded View

Watterboy Check if Blank, If so, Check... 12-08-2011, 11:29 AM
tigeravatar Re: Check if Blank, If so,... 12-08-2011, 12:10 PM
Watterboy Re: Check if Blank, If so,... 12-08-2011, 12:26 PM
Haseeb Avarakkan Re: Check if Blank, If so,... 12-08-2011, 12:52 PM
Watterboy Re: Check if Blank, If so,... 12-08-2011, 01:13 PM
Haseeb Avarakkan Re: Check if Blank, If so,... 12-08-2011, 01:39 PM
  1. #1
    Registered User
    Join Date
    11-29-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Check if Blank, If so, Check the Next Cell

    I need to write a tricky formula/code to do a slightly more advanced form of subtraction. Here's the scenario:

    I have a long list of values, one value per day. I need to make a separate column that takes the value for the current day and subtracts the value from the day before. This is the easy part.

    The difficult part is that not every day has a value (therefore the cell is blank). If I could write formula/code that checks if the value is blank and if so checks the cell above if it is blank until it finds the next value to use in the subtraction. If the cell itself is "~" then it returns "Null". Here's an example to help clarify

    Value----------------Subtraction
    --4
    --7------------------------3
    --12-----------------------5
    --15-----------------------3------.
    ---~----------------------Null-----l----- Skips the null and subtracts the 15 from 20, resulting in 5
    --20-----------------------5------'
    --22-----------------------2------.
    ---~----------------------Null-----l
    ---~----------------------Null-----l-----Skips the 3 nulls and subtracts the 22 from 30, resulting in 8
    ---~----------------------Null-----l
    --30-----------------------8------'

    Hopefully there is a way around this. Any help is appreciated! Thanks a lot for reading
    Last edited by Watterboy; 12-08-2011 at 11:34 AM.

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