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, 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
     
    Charlotte E., Apr 25, 2014
    #2
    1. Advertisements

Ask a Question

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.