+ 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
    153

    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 Guru Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    19,970

    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



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

    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 Guru Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    19,970

    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
    153

    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 Guru Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    19,970

    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
    153

    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)

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