Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2023, 02:01 AM
adman adman is offline Extract data from many cells into 1 cell Mac OS X Extract data from many cells into 1 cell Office 2016 for Mac
Novice
Extract data from many cells into 1 cell
 
Join Date: Jun 2023
Posts: 3
adman is on a distinguished road
Default Extract data from many cells into 1 cell

Hi, How do I extract data from many cells into 1 cell? I want the data in 1 cell for each tableName and the ColumnName values to follow. Eg:

(Apples,Red,Green,Blue,Orange) to display from the below table in the same cell. And then
(Bananas,Red,Green,Blue,Pink)
(Grapes,Green, Blue,Pink)
(Pears,Red)

each () being a single cell.

tableName ColumnName
Apples Red
Apples Green
Apples Blue
Apples Orange
Bananas Red
Bananas Green
Bananas Blue


Bananas Pink
Grapes Green
Grapes Blue
Grapes Pink
Pears Red

Thanks in advance.
Reply With Quote
  #2  
Old 06-09-2023, 01:45 AM
p45cal's Avatar
p45cal p45cal is offline Extract data from many cells into 1 cell Windows 10 Extract data from many cells into 1 cell Office 2019
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Try the single-celled formula:
Code:
=BYROW(UNIQUE(Table1[tableName]),LAMBDA(tn,tn & "," & TEXTJOIN(",",TRUE,FILTER(Table1[ColumnName],Table1[tableName]=tn))))
2023-06-09_094502.jpg


A little shorter:
Code:
=BYROW(UNIQUE(Table1[tableName]),LAMBDA(tn,TEXTJOIN(",",TRUE,tn,FILTER(Table1[ColumnName],Table1[tableName]=tn))))
I'm sure it could be streamlined more…


Edit: Apologies! I just saw you're using Excel 2016.



Reply With Quote
  #3  
Old 06-09-2023, 02:33 AM
p45cal's Avatar
p45cal p45cal is offline Extract data from many cells into 1 cell Windows 10 Extract data from many cells into 1 cell Office 2019
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

With Excel 2016 you have Power Query built-in so in the attached, you can change the data in the blue table on the left, then right-click the green table on the right and choose Refresh, to update the results.


2023-06-09_103056.jpg
Attached Files
File Type: xlsx msofficeforums50958.xlsx (16.9 KB, 3 views)
Reply With Quote
  #4  
Old 06-09-2023, 09:22 PM
adman adman is offline Extract data from many cells into 1 cell Mac OS X Extract data from many cells into 1 cell Office 2016 for Mac
Novice
Extract data from many cells into 1 cell
 
Join Date: Jun 2023
Posts: 3
adman is on a distinguished road
Default

Hi p45cal,

Thank you very much for your help. I don't know much about Power Query. How did you tell it to group the info in the blue table? I down loaded your spreadsheet but it's saying external data connection is disabled?

Thanks again.
Reply With Quote
  #5  
Old 06-10-2023, 12:27 AM
p45cal's Avatar
p45cal p45cal is offline Extract data from many cells into 1 cell Windows 10 Extract data from many cells into 1 cell Office 2021
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by adman View Post
but it's saying external data connection is disabled
Usually, Excel asks you if you want to enable it, to which you answer that you want it enabled. In this case there are no external connections, it's just what Excel does!
Come back if it doesn't ask the question; it may be some security setting...
Reply With Quote
  #6  
Old 06-10-2023, 02:04 AM
adman adman is offline Extract data from many cells into 1 cell Mac OS X Extract data from many cells into 1 cell Office 2016 for Mac
Novice
Extract data from many cells into 1 cell
 
Join Date: Jun 2023
Posts: 3
adman is on a distinguished road
Default

Hi p45cal,

I've got it up & working and it all works perfectly.

Thank you very much for all your help!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
filling in blank cells with data from cell above RayK Excel 1 01-12-2017 04:14 PM
Extract data from many cells into 1 cell Combining several cells data into one single cell H28Sailor Excel 6 01-09-2017 06:00 AM
How to populate cells in Sheet2 with Data Source query using cell data from Sheet1 bobznkazoo Excel 2 03-27-2014 11:14 AM
How can I fill the below emty cells with above cell data? Learner7 Excel 8 06-28-2011 12:10 PM
Extract data from many cells into 1 cell How to combine different cells data in one cell? Learner7 Excel 1 07-28-2010 12:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:41 AM.


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