Remove "," from macro output and concatenate values from two column with "/" only when both the cell have same uniqque key in the row

exlearner

New Member
Joined
Aug 23, 2017
Messages
1
Hi All,

I will try my best to explain both the problems I am currently facing. I have tried various options, have searched different forum as well. Not usre if this has been ask earlier.. appologies for repeat.. can someone please help..

Data Set: I am looking to transform my data from Column A, Column B and Column C to Column G and Column H
Key Points:
- ID is my unique key, there multiple rows with same ID value, I need to pick a row that has value in Column D and copy it in another sheet. This has been done.

Problem1: For those rows with same ID value I need to pick distinct values from Column A and copy it in Column , basically concatenate. I am getting value as --> ,11,12,
Here i am using below formula.. not sure what else i need to do to remove the extra comma's.
=IF(D2="NA","NA",IF(Sheet1!L2="Unique",SUBSTITUTE(SUBSTITUTE(CONCAT(IF(Sheet1!$U$2:$U$5000=Q2,","&Sheet1!$AY$2:$AY$5000,"")),",","",1),",,",""),"NA"))

--- > copying exact formula above, column in the data set shared and the one in the formula is not exact.
Problem2: in Column H, I need to pic value from Column A, concatenate with Column B (if not blank) with "/" in between and copy in the row where I have non blank value in Column D. Actually I am copying in separate sheet but that will be easy once I have the formula

IDColumn AColumn BColumn CColumn DColumn GColumn H
1606110D16060/61, 60/62
16062 NANANA
1 9NANANA
2 8D21010/100
2101008NANANA
31107NANANA
31290 D311, 1211/0, 12/90
3 NANANA
4 6D4NANA
4 5NANANA

<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>
 

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.

Forum statistics

Threads
1,215,771
Messages
6,126,799
Members
449,337
Latest member
BBV123

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