increment a number by amount of times a value exists in another column

spyrule

Board Regular
Joined
Aug 21, 2015
Messages
114
Hello,

I realize this will likely require an excel macro, but I'm not sure how to write this one...

I've got the following kind of data in one worksheet:

SKUPARENT SKU
OB1
PR1OB1
FR3OB1
X8OB1
LT
IT1LT
OI4LT
LK-4855OB1
IT-9855

<tbody>
</tbody>


I would like to build a destination worksheet like :

codeSKULinked_skuPositionQTY
CPOB10.00
CPOB1PR110.00
CPOB1FR320.00
CPOB1X830.00
CPOB1LK-485540.00
CPLT0.00
CPLTIT110.00
CPLTOI420.00

<tbody>
</tbody>

Most of this content I have working, the only thing I cannot figure out how to do easily, is to populate the position column. I have several thousand rows, and no way to "group" by parent sku before creating the list, so I need some kind of either macro or formula to create an incremental value based on how many times the parent SKU is listed besides a SKU, and then show that sequence in the destination worksheet.

Thanks in advance.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
Office Version
  1. 365
Platform
  1. Windows
Assuming your SKU column in the bottom table is column B. Put this formula in Cell D2 and copy down
=IF(AND(B2<>"",C2<>""),COUNTIFS(B$2:B2,B2,C$2:C2,"<>"),"")

Jeff
 

Watch MrExcel Video

Forum statistics

Threads
1,130,117
Messages
5,640,208
Members
417,131
Latest member
Seanr19871

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
Top