+ Reply to Thread
Results 1 to 12 of 12

Increasing a number in the center of a cell

  1. #1
    Registered User
    Join Date
    11-15-2014
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    8

    Increasing a number in the center of a cell

    Hello all,

    I have a question. I know how to make excel increase a number as you drag it down, but I need to do that in the middle of a string of numbers. It is easiest to explain it....

    I am inventorying stuff and the code each unit is identified by follows the format: "A000AA" So an actual code would be G284XR. I cannot figure out how on earth to make it increase the three digit number in the center as I drag down. I would love to be able to type G200XR, then G201XR and drag it so it automatically increases.

    Is there ANY way to do this? Because typing in every single one is going to kill me.

    Thanks!

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,108

    Re: Increasing a number in the center of a cell

    if the format is always the same - you could put
    G200XR in cell A1
    then in A2
    =LEFT(A1,1)&MID(A1,2,LEN(A1)-3)+1&RIGHT(A1,2)

    and copy down

    and then Click on the column
    Copy
    Paste Special
    Value
    to replace the formula with a number
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Increasing a number in the center of a cell

    a quick cheat would be to drag a column (we'll assume A) down to get the list of numbers you want then in B1 put ="G" & A1 & XR", drag that down then copy that column, and paste it back in using Paste Special - Values.

    then delete Column A

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,286

    Re: Increasing a number in the center of a cell

    Or A1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and drag down


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,947

    Re: Increasing a number in the center of a cell

    Are these numbers referenced anywhere else in the workbook? When does "G" turn to "H"? Etc.
    Ben Van Johnson

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Increasing a number in the center of a cell

    Assume G200Xr is in A1, then in A2 = =LEFT(A1,1) & (MID(A1,2,3)*1+1) & RIGHT(A1,2) and copy down
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Increasing a number in the center of a cell

    Maybe like this

    ="G"&TEXT(ROW($A1),"000")&"XR"

    Row\Col
    A
    1
    G200XR
    2
    G201XR
    3
    G202XR
    4
    G203XR
    5
    G204XR
    6
    G205XR
    7
    G206XR
    8
    G207XR
    9
    G208XR
    10
    G209XR
    Last edited by AlKey; 11-15-2014 at 04:21 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Increasing a number in the center of a cell

    Yet another one...

    A1 = G200XR

    This formula entered in A2 and copied down:

    =REPLACE(A1,2,3,200+ROWS(A$2:A2))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Increasing a number in the center of a cell

    if G200XR was in A1 the formula below could be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then when you drag down the inside will change.

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,108

    Re: Increasing a number in the center of a cell

    which ever solution you choose to use - make sure it works when the number is over 3 digits 1001

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,286

    Re: Increasing a number in the center of a cell

    Please see the attached workbook which demonstrates all the formulae.

    Regards, TMS
    Attached Files Attached Files

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Increasing a number in the center of a cell

    Quote Originally Posted by etaf View Post
    which ever solution you choose to use - make sure it works when the number is over 3 digits 1001
    The OP said:

    Quote Originally Posted by lightsandsirens5 View Post
    I cannot figure out how on earth to make it increase the three digit number in the center as I drag down.
    So my suggestion only works correctly up to 3 digits.

+ 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. Printing multiple pages with increasing cell number
    By itsame in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2014, 02:28 AM
  2. Copy formula with increasing cell number
    By thomasse in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-08-2014, 11:26 AM
  3. Increasing number in formula when copying/pasting into another cell
    By seaottr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-16-2013, 06:24 PM
  4. Replies: 8
    Last Post: 04-22-2013, 11:56 PM
  5. [SOLVED] how do I paste without EXCEL increasing the cell number ?
    By cgs in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-18-2006, 07:35 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