Generate name based on cell data

jesskidn

New Member
Joined
Feb 27, 2023
Messages
5
Platform
  1. MacOS
Hi i need a formula for column G "job number" to generate based on the information in cells A-D. Would be great if it would populate as you type the data, separated by underscores and the number based on the division code increases.

for example, in the below, the job number would be "Self_NYM_Newsletter_001"
if there was another NYM code, the number would increase to "Self_NYM_Newsletter_002"
and if there is another division code, the number would restart to 001.

let me know if this makes sense, or if you need more information to help with this formula(s).


Screenshot 2023-02-27 at 8.05.09 PM.png
 

Attachments

  • Screenshot 2023-02-27 at 8.05.09 PM.png
    Screenshot 2023-02-27 at 8.05.09 PM.png
    27.8 KB · Views: 5

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
It is a perfect oppurtunity to use countifs.
G2:
Excel Formula:
=A2&"_"&C2&"_"&D2&"_"&COUNTIFS($A2:A2,$C$2:C2,$D$2:D2)
 
Upvote 0
It is a perfect oppurtunity to use countifs.
.. but I don't think that you tested it? ;)

@jesskidn
Welcome to the MrExcel board!
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have TEXTJOIN you could try col G otherwise the formula that I think @Flashbond meant to post (col H)

Cell Formulas
RangeFormula
G2:G6G2=TEXTJOIN("_",,A2,C2,D2,COUNTIFS(A$2:A2,A2,C$2:C2,C2,D$2:D2,D2))
H2:H6H2=A2&"_"&C2&"_"&D2&"_"&COUNTIFS(A$2:A2,A2,C$2:C2,C2,D$2:D2,D2)
 
Upvote 0
Solution
.. but I don't think that you tested it? ;)

@jesskidn
Welcome to the MrExcel board!
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have TEXTJOIN you could try col G otherwise the formula that I think @Flashbond meant to post (col H)

Cell Formulas
RangeFormula
G2:G6G2=TEXTJOIN("_",,A2,C2,D2,COUNTIFS(A$2:A2,A2,C$2:C2,C2,D$2:D2,D2))
H2:H6H2=A2&"_"&C2&"_"&D2&"_"&COUNTIFS(A$2:A2,A2,C$2:C2,C2,D$2:D2,D2)
I forgot the criterias, didn't I 😁 Sorry 😅
 
Upvote 0
Flashbond and Peter_SSs – Thank you VERY much. Both of these solutions are extremely helpful.

NOTE: I thought i posted an update that i was using google sheets, but it looked like i didnt hit post. Either way, i updated the about me section of my profile, as google sheets isnt an option to choose in the pre-determined options.
 
Upvote 0
Since this now appears to be a Google Sheets question, I have moved it out of the Excel Questions forum into the correct forum.
Note the information on the main forum index page and please ask any future Google Sheets questions in the appropriate forum.

1677627261071.png
1677627305563.png


Never-the-less, I'm glad the suggestions helped. Thanks for letting us know.
 
Upvote 0
In case you really want/need those leading 0's:
Book1
ABCD
1ClientDivision CodeDescriptionJob Number
2SelfNYMNewsletterSelf_NYM_Newsletter_001
3SelfNYMNewsletterSelf_NYM_Newsletter_002
Sheet1
Cell Formulas
RangeFormula
D2D2=TEXTJOIN("_",TRUE,A2,B2,C2,TEXT(COUNTIFS(A$2:A2,A2,B$2:B2,B2,C$2:C2,C2),"00#"))
D3D3=A3&"_"&B3&"_"&C3&"_"&TEXT(COUNTIFS(A$2:A3,A3,B$2:B3,B3,C$2:C3,C3),"00#")
 
Upvote 0

Forum statistics

Threads
1,223,315
Messages
6,171,400
Members
452,398
Latest member
InvoicingNoob

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