How to correct the formula so the sequence is correct?

Sampoline

New Member
Joined
Dec 2, 2020
Messages
24
Office Version
  1. 2013
Platform
  1. Windows
1606977951857.png


From the above picture, you can see that I'm trying to combine the name together. The 2nd column is sequence numbers. I want to convert it to a 4-digit format. I've got that part right. But not too sure how to proceed with correcting the sequencing. Any solutions?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hummmm...
Basically you are asking to correct the formula so you get the right result, and let us guessing which is the right result.

Well, my guess is that this formula could do the job:
Excel Formula:
=S2&"_"&TEXT(T2,"000")

If that formula give you the correct answer, then you might consider this second formula, that doesn't need column T for creating the sequence:
Excel Formula:
=S2&""_""&TEXT(COUNTIF($S$2:S2,S2),"0000")
This counts the occourrences of the code to create the sequence

If my guess don't met your expectations then I suggest that you explain which results you are looking for

Bye
 
Upvote 0
Solution
Also you can Use this:
Excel Formula:
=S2&"_"&REPT("0",4-LEN(T2))
 
Upvote 0
@Fluff , Sorry I think he wants only mix Cell S2 Data with 4 digit number from T2. This is Correct Formula:
=
Excel Formula:
=S2&"_"&REPT("0",4-LEN(ROW()-1))&ROW()-1
 
Last edited:
Upvote 0
If you try it, you'll see. ;)
 
Upvote 0

Forum statistics

Threads
1,214,588
Messages
6,120,412
Members
448,960
Latest member
AKSMITH

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