Formula to return a number based on the content of another cell

canarycat123

New Member
Joined
Sep 1, 2021
Messages
27
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi there, I’m hoping someone can help me with this question.

I have a series of formula being used to generate unique reference numbers, finishing with CONCATENATE, as seen in the screencap attached. I am using a simple =IF(H60=””,””,ROW()-2) formula to generate the final four digits of the reference number. However, what I am trying to achieve is slightly more complex.

The first portion of characters, in this example KGV and MISC (produced in another cell using VLOOKUP), represent different geographical areas. What I would like to achieve is a formula that can identify the next number in the series related to each geographical area. So, in the attached example I would like MISC to return MISC-LS-020-001 (rather than -0058), as that would be the first KGV record in the worksheet. If I were then to add another MISC I want it to return 002 and so on. If I were then to add another KGV record it should start with the next number in the sequence related to KGV, 0058 in this example.

Any help/advice would be appreciated!
 

Attachments

  • Ref Example.PNG
    Ref Example.PNG
    3.3 KB · Views: 16

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Ok, how about
Excel Formula:
=TEXTJOIN("-",,A2:C2,TEXT(COUNTIFS(E$1:E1,A2&"*")+1,"0000"))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top