Increase count by 1 in column Z if duplicate found in column A

wtom0412

Board Regular
Joined
Jan 3, 2015
Messages
180
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I am writing a module to import data from a particular Web Page Builder (WPB) into Shopify.

I am basing the import on a unique ID from WPB in its Product Image Database. The WPB database can have the same unique ID represented multiple times in the data set, one for each image that is used for that product.

Shopify also uses a unique ID it calls "Handle" - it too can be in the data set multiple times when there are more than one image for a product,

For multiple images for a single product, Shopify requires that the Image Position column is denoted with a 1, 2, 3 and so on so it can assign those images to a product in the correct order.

So, if Product A has a unique ID of 1234 in the WPB database, and there are 5 images associated with the product, then 1234 will be represented 5 times in the data set, with the only difference being the image URL. The same logic applies to Shopify.

I need for the code to recognise the ID from WPB is represented multiple times, and increment the Image Position by 1 when it encounters the duplicates.

Again, using the above example, the first time 1234 is in the Shopify data set, it will have the value 1 in the Image Location column, the second time it appears will have 2 and so on until the last time it appears it will have a 5.

I hope that makes sense, and some brilliant person can help!!

Cheers, Toby.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
In cases like these, you are often more likely to get assistance if you can post a sample of your data along with showing your expected results (often times, seeing the structure of the data and expected results are easier to understand than verbose explanations with no images).

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,224,808
Messages
6,181,073
Members
453,020
Latest member
mattg2448

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