Concat Duplicate Data

spyldbrat

Board Regular
Joined
May 5, 2002
Messages
211
Office Version
  1. 365
In col K I have list of locations. In column G, I have list of dates. If column D contains the words "Store-00989" and column G has the same date listed on another row, that shares the specific words in d, then in col E, I want to concat the data to show the location name in G and the words "Shift 1" (Example: Store-00989 Shift 1). If another row contains the same duplicate information, then I would like the words "Shift 1" to read "Shift 2" and so on. If there are no duplicates between D & G that do not meet this criteria, then the result should be location name listed in G.

I am not sure if it is possible to change the # after shift, but I need to make each of these duplicate shifts unique.
 
Kweaver - the formula only shows for 1 Store not the additional store that I added...but thank you for your help!!!!
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I guess I don't see what new store you added as there's no additional image.
 
Upvote 0
You could use an OR in your IF

=IF(OR(COUNTIFS(D:D,"Store-00989",G:G,G2)>1,COUNTIFS(D:D,"Loc-1971",G:G,G2)>1),D2&" Unarmed "&COUNTIFS(D$2:D2,D2,G$2:G2,G2),D2)

For some reason, when I apply your formula to the sample spreadsheet it works fine. When I change the words within the quotes to match up to my "real" data, it's applying Unarmed 1, 2 to every row in the column?
 
Upvote 0
Hard to say what the difference is...

Try ="Real Data"=D2 (or whatever cell has the data. If FALSE you may need TRIM
="Real Data"=TRIM(D2)
 
Upvote 0
This is what I have in my real data. Am I missing something?

=IF(OR(COUNTIFS(D:D,"BL-000154",G:G,G2)>1,COUNTIFS(D:D,"RA2709",G:G,G2)>1),D2&" Unarmed "&COUNTIFS(D$2:D2,D2,G$2:G2,G2),D2)
 
Upvote 0
It looks fine. How about comparing the BL-000154 and RA2709 cells, and the dates =CELL=CELL there must be something there not matching.
 
Upvote 0
What is confusing me is that every row in this column, even the ones that do apply to to what is in quotes in column D has unarmed 1, 2 etc after it?
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,387
Members
449,080
Latest member
Armadillos

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