+ Reply to Thread
Results 1 to 8 of 8

Formula required to calculate value in next cell if original cell is blank

  1. #1
    Forum Contributor
    Join Date
    05-11-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    270

    Formula required to calculate value in next cell if original cell is blank

    Dear Team,

    Can you please help me with the formula ?

    A B C D E G H Final Output Condition
    7 10 15 14 15 8
    9 10 12 15 6 if col A is blank, then Col E - Col B
    8 11 15 7 if col B is blank, then Col E - Col C
    10 15 5 if col C is blank, then Col E - Col D
    5 15 10 Since col B is non blank, then Col E - Col B

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Formula required to calculate value in next cell if original cell is blank

    We can't see what is in each cell.

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    05-11-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    270

    Re: Formula required to calculate value in next cell if original cell is blank

    Dear Team,

    PFA.

    Can you please help with the formula.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Formula required to calculate value in next cell if original cell is blank

    You might need to explain the last condition more fully, but this works for your sample sheet, in F2, copied down:

    =IF(AND(COUNTA(A2:D2)=1,B2<>""),E2-B2,IF(C2="",E2-D2,IF(B2="",E2-C2,IF(A2="",E2-B2,E2-A2))))
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-11-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    270

    Re: Formula required to calculate value in next cell if original cell is blank

    Thanks a lot.
    Formula is working perfectly.

    1 question.
    I need to add 1 more column before A.

    Can you let me know the updated formula.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Formula required to calculate value in next cell if original cell is blank

    Explain what you mean and post another sample sheet.

  7. #7
    Forum Contributor
    Join Date
    05-11-2013
    Location
    Mumbai
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    270

    Re: Formula required to calculate value in next cell if original cell is blank

    Dear Glenn,

    I am attaching revised file with few minor changes.

    Please assist since data is huge.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-06-2018
    Location
    In my mind, USA
    MS-Off Ver
    2016
    Posts
    16

    Re: Formula required to calculate value in next cell if original cell is blank

    It looks like you want the first filled cell subtracted from column E.
    The formula Glenn provided will only calculate column A if ALL the columns A-D are filled for the row.
    This will calculate the first filled column.
    =IF(A2<>"",E2-A2,IF(B2<>"",E2-B2,IF(C2<>"",E2-C2,E2-D2)))

    If you add a column before column A, that new cell becomes column A, and your old column A is now column B. Add another embedded "if" to the beginning of the formula (see sheet 2).

    OK... seeing what you posted, by adding the column to the left of column A, the formula automatically updates.

    Note: if column E is blank, you'll have a negative number in the result.

    It looks like there won't always be information in the reporting month either. You're looking at the difference between the customer's first order of the FY and the current month?
    Attached Files Attached Files
    Last edited by AmazinglyBlessed; 12-06-2018 at 08:05 AM.

+ 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. [SOLVED] How to stop a date formula from working if original cell is left blank
    By Mr.Bean in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2017, 01:53 PM
  2. Replies: 9
    Last Post: 06-10-2016, 10:05 AM
  3. [SOLVED] Formula: If cell 3 is blank have cell 1 calculate, if cell 3 filled have cell 2 calculate
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-05-2016, 09:34 AM
  4. Replies: 2
    Last Post: 10-24-2014, 12:12 PM
  5. Calculate differnce between 2 dates, but if 1 date cell is blank leave cell blank
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-11-2014, 11:31 PM
  6. Formula to calculate if cell A* is the first non-blank, then...
    By galaxy_madness in forum Excel General
    Replies: 7
    Last Post: 11-25-2011, 04:30 PM
  7. Replies: 1
    Last Post: 06-26-2011, 07:39 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