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

spyrule

Board Regular
Joined
Aug 21, 2015
Messages
113
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.
 

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,604
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
 

Forum statistics

Threads
1,078,447
Messages
5,340,345
Members
399,370
Latest member
salamon

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top