+ Reply to Thread
Results 1 to 17 of 17

Formulas to create a numbering based on other cells values

  1. #1
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12

    Exclamation Formulas to create a numbering based on other cells values

    The formula in Z is looking to the formula in X and generates the unique identifier based on the values in columns B, J, and V. Here's a breakdown of the formula:

    IF(V5<>"", ...) checks if the value in cell V5 is not empty.
    If the condition is true (V5 is not empty), the formula continues to the inner IF statement.
    IF(B5="", "", CONCATENATE("CTRI-", VLOOKUP(K5, Clients, 2, FALSE), TEXT(ISOWEEKNUM(J5), "00"), TEXT(ROW($B$4) - ROW(B5), "000"))) checks if the value in cell B5 is empty.
    If the condition is true (B5 is empty), it returns an empty string.
    If the condition is false (B5 is not empty), the CONCATENATE function is used to create the unique identifier.
    "CTRI-" is a constant string used as a prefix for the identifier.
    VLOOKUP(K5, Clients, 2, FALSE) performs a VLOOKUP function using the value in cell K5 as the search key. It searches for a matching value in the "Clients" range and retrieves the corresponding value from the second column.
    TEXT(ISOWEEKNUM(J5), "00") extracts the ISO week number from the date in cell J5 using the ISOWEEKNUM function and formats it as a two-digit number.
    TEXT(ROW($B$4) - ROW(B5), "000") calculates the row number difference between the current row and the fourth row in column B. It formats the difference as a three-digit number.
    If any error occurs during the evaluation of the inner IF statement, the IFERROR function returns an empty string.
    If the condition in the outer IF statement (V5 is not empty) is false, the entire formula returns an empty string.
    Therefore, the formula in Z5 is dependent on the formula in X5, as it uses the same logic to generate the unique identifier based on the conditions and values in the corresponding rows.


    What I want is that the formula in z, after looking to X and found no repetition to continue with the next numbering 002,003,004
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,864

    Re: Formulas to create a numbering based on other cells values

    If the above is based on sheet"Register", then you need check your columns e.g. Column K is "Type of Waste" / colummn J are not dates ....
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12
    Quote Originally Posted by JohnTopley View Post
    If the above is based on sheet"Register", then you need check your columns e.g. Column K is "Type of Waste" / colummn J are not dates ....
    John unfortunately the file is 2MB and is failing upload 😢😢

  4. #4
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12
    Quote Originally Posted by JohnTopley View Post
    If the above is based on sheet"Register", then you need check your columns e.g. Column K is "Type of Waste" / colummn J are not dates ....

    And you are right the files I sent it wrong.

  5. #5
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12

    Re: Formulas to create a numbering based on other cells values

    John...do you have another way I can send you the files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,977

    Re: Formulas to create a numbering based on other cells values

    Cut the file down - we need to see a sample only (one that shows the issue).
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12

    Re: Formulas to create a numbering based on other cells values

    I have attached screenshots

    C5 has formula "=K5&J5&E5"
    F5 has formulas "=IFERROR(IF(B5="","",CONCATENATE((TEXT(WEEKNUM(B5),"00")),(VLOOKUP(K5,Clients,2,FALSE)),(TEXT(ROW($B$4)-ROW(B5),"000")))),"")"
    I5 has formulas: "=IF(OR(K5="",H5=""),"",(K5&H5))"
    V5 has formulas: "=IF(U5="","",IF(U5=0%,"Não iniciado",IF(U5<100%,"Em progresso",IF(U5=100%,"Concluido",IF(U5="Em Espera","Pendente",IF(U5="Cancelado","Cancelado",""))))))"
    X5 has formulas: "=IF(V5<>"",IFERROR(IF(B5="","",CONCATENATE("CTRI-",(VLOOKUP(K5,Clients,2,FALSE)),(TEXT(ISOWEEKNUM(J5),"00")),(TEXT(ROW($B$4)-ROW(B5),"000")))),""),"")"
    Z5 has formulas: "=IF(U5<>100%,"",IF(X5="","",IF(AND(COUNTIF(K$4:K5,K5)>1,COUNTIF(H$4:H5,H5)>1),VLOOKUP(I5,$I$5:$X$2000,16,FALSE),X5)))"
    Attached Images Attached Images

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,977

    Re: Formulas to create a numbering based on other cells values

    No - screenshots will NOT do.

    Attach a SAMPLE workbook that is cut down to show SOME (not all) of your data that demontrsates the issue.

    You are expecting people to help you - you need to make a bit of effort to provide them with usable data.

  9. #9
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12

    Re: Formulas to create a numbering based on other cells values

    Here we go ...I have been able to send the files.
    What I need to achieve is to have the formulas on column Z to have the last 3 digits subsequent

    Número do Certificado
    CTRI-1202-001 ---ok
    CTRI-1202-001 ---ok
    CTRI-1202-001 ---ok
    CTRI-1202-001 ---ok
    CTRI-1202-001 ---ok
    Empty - The formula should reserve 002
    CTRI-3107-007 --- This one should be 003
    CTRI-1205-008 --- This one should be 004
    CTRI-1205-008 --- This one should be 004
    CTRI-1205-008 --- This one should be 004
    CTRI-1205-008 --- This one should be 004
    CTRI-1205-008 --- This one should be 004
    CTRI-1205-008 --- This one should be 004
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-1206-014 --- This one should be 005
    CTRI-3107-007 --- This one should be 003
    CTRI-1215-024 --- This one should be 006
    Attached Files Attached Files

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Formulas to create a numbering based on other cells values

    Please try in Z5 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12

    Re: Formulas to create a numbering based on other cells values

    Unfortunately my excel doesn't have function "UNIQUE" . ..I'm still using an old version

  12. #12
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Formulas to create a numbering based on other cells values

    O sorry the formula in post #10 works only in Excel 2021 and 365.

    Here is another formula for Excel 2010, 2013, 2016 and 2019:

    Please try in Z5 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HansDouwe; 07-18-2023 at 10:09 AM. Reason: Formula corrected

  13. #13
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12

    Re: Formulas to create a numbering based on other cells values

    Thank you @hansDouwe for your response - I tried to change the values for fews cells to see if the formulas works but it seems not to work.
    The idea here is to have the same certificate number when the client name (column K) and the PO number (Column H) are the same.

  14. #14
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Formulas to create a numbering based on other cells values

    Please attach a workbook and show us the unpexpected results.

    Please provide for a realistic sample also.

    In your sample if PO number is the same, client name is also the same.
    My formula assumes that this is always the case and returns exactly the stated expected result.

    If different names are possible whitin the same PO number, enter that also in your sample workbook as well and show us that the formula should return different values.

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

    Re: Formulas to create a numbering based on other cells values

    Change the countif to a countifs:
    =IF(U5<>1,"",IFNA(INDEX(Z$4:Z4,MATCH(H5,H$4:H4,0)),LEFT(X5,10)&TEXT(SUM(1/(COUNTIFS(H$4:H4,H$4:H4&"",K$4:K4,K$4:K4&""))),"000")))
    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

  16. #16
    Registered User
    Join Date
    05-27-2022
    Location
    angola
    MS-Off Ver
    MS office Pro Plus 2016
    Posts
    12

    Re: Formulas to create a numbering based on other cells values

    Glen, you formulas has to be reviewed because if you change the client name for an existing lines, it doesnt change the certificate number (column Z)
    Please do a test by changing the client name (column K) and the PO number (column H) for e.g lines 8 and 9 - THE Final result (column Z) gives CTRI-1502-002.
    However we had already a certificate with end digit "002" which become a 003. the idea here is to avoid a given certificate number to change as we manipulate the others data.

  17. #17
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Formulas to create a numbering based on other cells values

    Please try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HansDouwe; 07-19-2023 at 11:21 AM. Reason: Formula and spreadshead replaced

+ 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] Based on 2 criteria checks, create sequence numbering
    By nerzzul in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-02-2023, 06:44 AM
  2. [SOLVED] Create a reference to a cell based on 2 other cells values
    By Vaslo in forum Excel General
    Replies: 3
    Last Post: 10-03-2018, 11:35 AM
  3. Replies: 1
    Last Post: 02-17-2017, 10:25 AM
  4. How to create a list based on values in a range of cells?
    By 70pjsmith in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-29-2015, 01:25 PM
  5. [SOLVED] 0 Value Cell Formula to create 0 values in other cells that have references formulas.
    By olyneum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-31-2013, 02:33 AM
  6. Create folder structure based on values in Cells
    By Traymond in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2011, 02:59 PM
  7. [SOLVED] Summing cells values based on IF formulas
    By Seamus Conlon in forum Excel General
    Replies: 2
    Last Post: 10-11-2005, 11:05 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