+ Reply to Thread
Results 1 to 4 of 4

Incrementing numbers based on previous values and text values of a previous cell

  1. #1
    Registered User
    Join Date
    09-22-2020
    Location
    London
    MS-Off Ver
    O365
    Posts
    6

    Incrementing numbers based on previous values and text values of a previous cell

    Bit of a complicated one here.
    In column A I have the type of work being carried out, selected from a dropdown. In column B I would like to see the abbreviation of that (see M1:N7 for this data but it's pretty obvious) plus a number. I would like these to increase and populate automatically, without resetting the count.
    It should make sense in the attached sheet.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Incrementing numbers based on previous values and text values of a previous cell

    Like this??

    =IFERROR(VLOOKUP(A2,M:N,2,FALSE)&TEXT(COUNTIF(A$2:A2,A2),"000"),"")

    copied down.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Incrementing numbers based on previous values and text values of a previous cell

    You can adjust the number of leading 0s from the bit in red.

    =IFERROR(VLOOKUP(A2,M:N,2,FALSE)&TEXT(COUNTIF(A$2:A2,A2),"000"),"")

    if you don't want ANY leading zeros, use:

    =IFERROR(VLOOKUP(A2,M:N,2,FALSE)&COUNTIF(A$2:A2,A2)

    but this may cuse problems later (C1, C11 and C111 may be more difficult to distinguish... depending on what you're doing).

  4. #4
    Registered User
    Join Date
    09-22-2020
    Location
    London
    MS-Off Ver
    O365
    Posts
    6

    Re: Incrementing numbers based on previous values and text values of a previous cell

    Amazing! Thank you Glenn, perfect.

    I don't fully understand how it works though.... might you be able to explain please?

+ 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. [SOLVED] SUM of previous three values based on the same text in two columns
    By smide in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-10-2017, 06:08 AM
  2. [SOLVED] dropdown lists based on previous cell values
    By var in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-10-2016, 03:46 PM
  3. Formula based on more than 240 of previous cell values
    By dedark05 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-28-2016, 10:40 PM
  4. How to determine values based on a previous cell
    By Kastalarial in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2013, 06:26 AM
  5. Replies: 0
    Last Post: 10-14-2011, 12:09 PM
  6. Macro - auto populate the values based on previous cell values
    By Avinash Kumar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-05-2009, 02:02 AM
  7. Replies: 4
    Last Post: 06-04-2009, 04:56 AM

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