+ Reply to Thread
Results 1 to 5 of 5

Unique Report Number Using Formula

  1. #1
    Forum Contributor
    Join Date
    09-25-2018
    Location
    Grimsby, UK
    MS-Off Ver
    365
    Posts
    149

    Unique Report Number Using Formula

    Hi,

    I have a formula that creates a unique report number. The formula looks at the location, the type of job and also the year the work was carried out. Based on this a number is given (please note the report number also contains letters).

    This works great except when you have 2 job at the same location in the same year as the number are the same. I wold like the number to ascend accordingly.

    Below is my formula the last digit (1) is what I would like to increase but only of there is already another job/jobs that match.
    Please Login or Register  to view this content.
    I have also attached the workbook in case I haven't explained this well enough. In column A the two yellow cell are the same as the location, job type and date match, this in an example of where i would like the next one down to increase by 1 .

    Also, i have tried to make the number 3 digits minimum (001,002 etc) but I cant get that to work either.

    Thanks for your time.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: Unique Report Number Using Formula

    Updated formula in attachment. This counts how many combinations of location/year there are for each job and assigns the appropriate number.

    However, remember that with any formula solution, the results are going to get scrambled if you sort this table, or delete or insert rows in the middle of the table. If you need the number to be assigned once and stick no matter what else you do, you will have to use VBA.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Unique Report Number Using Formula

    Try this in A2. Sorting of data do not affect the formula result. Try if required.
    Please Login or Register  to view this content.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,219

    Re: Unique Report Number Using Formula

    Just BTW @kvsrinivasamurthy, sorting of data DOES affect the formula result. Change Date in E3 to 7/1/2021 and then sort by date (Newest to oldest). Prior to sorting, the suffix in A1 is 001. After sorting it changes to 002. Like 6StringJazzer says, I don't think there's any formula solution that will keep the value from changing upon sorting.

  5. #5
    Forum Contributor
    Join Date
    09-25-2018
    Location
    Grimsby, UK
    MS-Off Ver
    365
    Posts
    149

    Re: Unique Report Number Using Formula

    Thanks, that worked perfectly.

    As for sorting the data, that wont be an issue as it wont be required. Only filtering will be used

+ 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. Macro to select a column that varies in number of rows from report to report
    By karmadog62 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2019, 04:43 PM
  2. [SOLVED] unique number formula
    By louis128 in forum Excel General
    Replies: 28
    Last Post: 01-20-2019, 08:55 AM
  3. [SOLVED] Formula to get Unique number of names
    By rizmomin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-07-2019, 10:36 AM
  4. [SOLVED] Formula to report most popular product based on highest number of orders
    By lloydrees88 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-09-2015, 08:16 AM
  5. Replies: 15
    Last Post: 11-11-2013, 08:21 PM
  6. How to report number of UNIQUE cells on new sheet?
    By JGCA in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-25-2008, 08:22 PM
  7. [SOLVED] Can an Array formula count unique values and report no. of times for each?
    By Father Guido in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-21-2005, 02:06 AM

Tags for this Thread

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