Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old Yesterday, 06:48 AM
teza2k06 teza2k06 is offline How to remove all my duplicate values and combine certain cells Windows 10 How to remove all my duplicate values and combine certain cells Office 2016
Advanced Beginner
How to remove all my duplicate values and combine certain cells
 
Join Date: Feb 2013
Posts: 38
teza2k06 is on a distinguished road
Default How to remove all my duplicate values and combine certain cells

I have a spreadsheet with a large list of medications and the areas where they are kept. Each row shows a different area.

I want to remove all the duplicate values for the medications, but have all the areas combined into 1 cell separated by commas.

It might be a lot to ask, but can anyone help with the best way to do this

It will make the list a lot shorter (which I need), but will have all the locations together



I have attached an example of what I am after
Attached Files
File Type: xlsx example.xlsx (9.7 KB, 5 views)
Reply With Quote
  #2  
Old Yesterday, 09:27 AM
ArviLaanemets ArviLaanemets is offline How to remove all my duplicate values and combine certain cells Windows 8 How to remove all my duplicate values and combine certain cells Office 2016
Expert
 
Join Date: May 2017
Posts: 960
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

It's possible, but do you really want to do this in such a way?

To do this you need a helper column in your original table, which calculates for every row the occurrence number (1, 2, 3, ... etc.) for current medication there. And then in other table you need a formula which reads the max occurrence number for particular medication, and concatenates x times the area of every occurrence of it in case this occurrence number is less or equal of max occurrence for this medication, or adds an empty string in case in case this occurrence number is greater of max occurrence for this medication. And the number of concatenations must be egual with greatest max occurrence number in whole table (i.e. x I used above) . The formula will grow huge very fast when at least one of medications may be present in many areas.

Why do you not simply:
use autofilter on your original table to get all locations of specific medication;
or order your table by medications, so all locations for every medication are grouped together. (And order them by locations in case you need all medications in every location to be grouped together)
Reply With Quote
  #3  
Old Yesterday, 09:19 PM
Alansidman's Avatar
Alansidman Alansidman is offline How to remove all my duplicate values and combine certain cells Windows 11 How to remove all my duplicate values and combine certain cells Office 2021
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 121
Alansidman has a spectacular aura aboutAlansidman has a spectacular aura aboutAlansidman has a spectacular aura about
Default

Use Power Pivot and create a measure as shown in the attached file. Then look at this link for a tutorial on how this was created.
Excel: Reporting Text in a Pivot Table | IMA
Attached Files
File Type: xlsx example (1).xlsx (77.2 KB, 1 views)
__________________
Alan עַם יִשְׂרָאֵל חַ Using O365 v2511
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Combine "sort within groups" and "identify duplicate/unique values" in two different variables. civilcervant Excel 3 06-12-2017 07:27 AM
How to remove all my duplicate values and combine certain cells Combine documents makes duplicate word vincelge Word 2 05-15-2017 05:47 AM
How to remove all my duplicate values and combine certain cells How to remove duplicate vlookup values suniltko Excel 2 03-21-2017 10:52 AM
How to remove all my duplicate values and combine certain cells Combine values from different worksheets into a single worksheet. jimmy2016 Excel 2 10-06-2016 09:15 AM
How to remove all my duplicate values and combine certain cells Compare & remove both sets of duplicate values mummy Excel 1 03-28-2016 02:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft