+ Reply to Thread
Results 1 to 5 of 5

How to increment a number located mid string..

  1. #1
    Registered User
    Join Date
    09-20-2005
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office365
    Posts
    53

    How to increment a number located mid string..

    Hello all..

    I have this number format: 1655-01-32 and I need to have a formula that will increase the middle number by 1, for example 1655-01-32 incremented to 1655-02-32, then 1655-03-32, etc.

    What i wanted to do is type in the first number (1655-01-32), then have it auto increment 9 other times.

    Any help would be appreciated.

    -David

  2. #2
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: How to increment a number located mid string..

    Lets say (1655-01-32) is in cell A1.
    Then put this formula in Cell A2 and copy down as many times as needed.
    =SUBSTITUTE(A1,TEXT(MID(A1,FIND("-",A1)+1,2),"00"),TEXT(MID(A1,FIND("-",A1)+1,2)+1,"00"))

  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: How to increment a number located mid string..

    whoops noticed an error with my 1st equation where it substituted in rare occasions the first 4 digit number. Please use this equation instead in cell A2 and copy down..

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-20-2005
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office365
    Posts
    53

    Re: How to increment a number located mid string..

    Thanks Dosydos.

    I am running into a problem. The formula first changed the 1655 to 1656, then for the 2nd time, it starts to change the -01- to -02-

    So for me, C1 = 1655-01-32. I paste the formula in C13, then C25, C37, C49etc. C13 shows as 1656-01-32, then C25 shows as 1656-02-32, C37 shows as 1656-03-32, C49 shows as 1657-03-32.

    Not sure if that makes sense. but there is a pattern to it lol.

  5. #5
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: How to increment a number located mid string..

    I just tried doing everything you said in order. I started with 1655-01-32 in C1. I then pasted my 2nd formula in C13. It through up a #Value error as expected. I then changed all "A1" references in the formula to C1. This immediately changed the outcome of the formula to 1655-02-32. I then copied the updated formula in C13 and pasted in C25, C37, and C49. this gave me the output of 1655-03-32 , 1655-04-32 , and 1655-05-32 respectively.

+ 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. Increment numbers in string dynamically with regexp
    By max138 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-15-2021, 11:33 AM
  2. How to Increment a Alphanumeric String on Number of occurrences in Column
    By USFengBULLS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2019, 04:04 PM
  3. [SOLVED] Can't increment Alphanumeric string by one
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2016, 12:08 AM
  4. Firmula located number every 3 days
    By Berna11 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-05-2013, 02:17 PM
  5. Replies: 15
    Last Post: 07-05-2012, 12:49 PM
  6. [SOLVED] Can you dial a telephone number located in an cell?
    By Steve D. in forum Excel General
    Replies: 1
    Last Post: 11-20-2005, 01:10 AM
  7. [SOLVED] Need help, how to increment numbers for each unique text string.
    By tHeRoBeRtMiTcHeLL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2005, 04:05 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