Trying to calculate next sequential number using multiple columns

Discussion in 'Excel Programming' started by copastor, Apr 25, 2014.

  1. copastor

    copastor Guest

    Starting in Cell AI8, calculate the next sequential number using th
    last number from Column B. But only calculate for Cell AI8 if AG8
    "1'.

    In the screenshot attached, Cells AI8 and AI9 should remain blank. AI1
    should be 1261. AI11 should be 1262. AI12 should remain blank becaus
    AG12 is blank. The next sequential number should be 1263 in AI18

    +-------------------------------------------------------------------
    |Filename: Screenshot 2014-04-25 15.05.21.jpg
    |Download: http://www.excelbanter.com/attachment.php?attachmentid=971
    +-------------------------------------------------------------------


    --
    copastor
     
    copastor, Apr 25, 2014
    #1
    1. Advertisements

  2. copastor

    Charlotte E. Guest

    Can't see your screenshot - resolution too low...

    Are you looking for a VBA solution or a worksheet formula?

    You should take a look at the =MAX() worksheet function, something like:

    =IF ( AG8 <> 1 ; "" ; MAX ( AI$8 : AI8 ) + 1 )

    ....that's the worksheet formula, I would make, and then copy down as long as
    needed.

    It should be fairly easy to convert this to VBA, if you want to :)


    CE



    "copastor" <> wrote in message
    news:...
    >
    > Starting in Cell AI8, calculate the next sequential number using th
    > last number from Column B. But only calculate for Cell AI8 if AG8
    > "1'.
    >
    > In the screenshot attached, Cells AI8 and AI9 should remain blank. AI1
    > should be 1261. AI11 should be 1262. AI12 should remain blank becaus
    > AG12 is blank. The next sequential number should be 1263 in AI18
    >
    > +-------------------------------------------------------------------
    > |Filename: Screenshot 2014-04-25 15.05.21.jpg
    > |Download: http://www.excelbanter.com/attachment.php?attachmentid=971
    > +-------------------------------------------------------------------
    >
    >
    > --
    > copastor




    ---
    Denne e-mail er fri for virus og malware fordi avast! Antivirus beskyttelse er aktiveret.
    http://www.avast.com
     
    Charlotte E., Apr 25, 2014
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Shauna Koppang

    Saving a File Generates a Sequential Number Name

    Shauna Koppang, Aug 22, 2003, in forum: Excel Programming
    Replies:
    1
    Views:
    108
    Diana
    Aug 23, 2003
  2. Karen Westerman

    sequential number generator

    Karen Westerman, Oct 21, 2003, in forum: Excel Programming
    Replies:
    2
    Views:
    159
    Jan Karel Pieterse
    Oct 21, 2003
  3. Barth Wilsey

    Using code to calculate a value in the next row

    Barth Wilsey, Dec 4, 2003, in forum: Excel Programming
    Replies:
    3
    Views:
    85
    Tom Ogilvy
    Dec 4, 2003
  4. martinrrrr - ExcelForums.com

    sequential number based another cell

    martinrrrr - ExcelForums.com, Sep 30, 2004, in forum: Excel Programming
    Replies:
    2
    Views:
    77
    martinrrrr - ExcelForums.com
    Sep 30, 2004
  5. Cyberwolf

    sequential number breaks

    Cyberwolf, Sep 23, 2005, in forum: Excel Programming
    Replies:
    1
    Views:
    74
  6. Jdean
    Replies:
    2
    Views:
    94
    Jdean
    Mar 9, 2006
  7. ryguy7272
    Replies:
    6
    Views:
    104
    Bernie Deitrick
    Oct 25, 2007
  8. ppeer
    Replies:
    13
    Views:
    305
    ppeer
    Feb 11, 2010
Loading...