Duplicate Value with Similar Code

RichTom44

New Member
Joined
Oct 23, 2023
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello, Everyone, how can I formulate the second column to generate a code with the same value or duplicate in the first column?

ValueCode
1231
1231
1231
4562
4562
1231
6783
6783
4562
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try

Libro1
AB
1ValueCode
21231
31231
41231
54562
64562
71231
86783
96783
104562
Hoja1
Cell Formulas
RangeFormula
B2:B10B2=IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,VLOOKUP(A2,A$1:B1,2,0))
 
Upvote 0
Hello @DanteAmor

I had a similar "problem" some time ago and as far as I can remember I used SUMPRODUCT, but I forgot what formula I have used and I cannot find the workbook anymore.

Is it possible to get a result with some combination of SUMPRODUCT?

Thanks in advance
 
Upvote 0
how can I formulate the second column to generate a code with the same value or duplicate in the first column?

In 365. It is not necessary to copy the formula down, just put the formula in B2 and it will automatically set all the results.

Excel Formula:
=XMATCH(A2:A10,UNIQUE(A2:A10),0)
 
Upvote 0
In 365. It is not necessary to copy the formula down, just put the formula in B2 and it will automatically set all the results:

Excel Formula:
=LET(a,A2:A10,XMATCH(a,UNIQUE(a),0))
 
Upvote 0
Is it possible to get a result with some combination of SUMPRODUCT?

I can only think of the same formula, but instead of count, use sumproduct, but it is better to use countif
Excel Formula:
=IF(SUMPRODUCT((A$2:A10=A10)+0)=1,MAX(B$1:B9)+1,VLOOKUP(A10,A$1:B9,2,0))
 
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,869
Members
452,679
Latest member
darryl47nopra

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