If Column is X, display text

FelVuk

New Member
Joined
Jan 2, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a list of names and all the countries. Column 1 is filled with names and the following columns represent all the countries of the world. In each row, there's an 'X' under the country that person has visited.
On another tab, I'm listing some of these names using the formula FILTER. In the following column I'd like to list every country where there's an 'X' for that person.
For example, in Cell A3, I have this formula: =FILTER(Table1[Name, first name];Table1[Age]=“20-25”;””), which gives Thomas. In Cell B3, I want all the countries where Thomas has an 'X', so that in Cell U3, I will get: Belgium, Tanzania, Poland.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Can you post some sample data.

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
My work pc wont let me use XL2BB.

Sheet 1:
NameAge 20-25BelgiumPolandTanzania
ThomasYesXX
KevinYesX
PeterNoX

Sheet 2:
Name
(=FILTER(Table1[Name];Table1[Age 20-25]="Yes";""))
Countries
?
Thomas
Kevin
 
Upvote 0
Thanks for that, how about
Fluff.xlsm
ABCDEFGHIJ
1NameAge 20-25BelgiumPolandTanzania
2ThomasYesXXThomasBelgiumPoland
3KevinYesXKevinPoland
4PeterNoX
Sheet1
Cell Formulas
RangeFormula
H2:H3H2=FILTER(Table1[Name],Table1[Age 20-25]="Yes")
I2:J2,I3I2=TOROW(IF(FILTER(Table1[[Belgium]:[Tanzania]],Table1[Name]=H2)="X",Table1[[#Headers],[Belgium]:[Tanzania]],1/0),2)
Dynamic array formulas.
 
Upvote 0
How about?:
(you'll have to extend to the full range of your data)

Libro1
ABCDEFG
1NameBelgiumGermanyItalyPolandTanzaniaUSA
2ThomasXXXX
3AnnaXX
4BillXX
5
6
7NameCountrys visited
8ThomasBelgiumPolandTanzaniaUSA
9AnnaGermanyItaly
10BillPolandTanzania
Hoja1
Cell Formulas
RangeFormula
C8:F8,C9:D10C8=FILTER($B$1:$G$1,FILTER($B$2:$G$4,$A$2:$A$4=B8)="X")
Dynamic array formulas.
 
Upvote 0
Thanks for that, how about
Fluff.xlsm
ABCDEFGHIJ
1NameAge 20-25BelgiumPolandTanzania
2ThomasYesXXThomasBelgiumPoland
3KevinYesXKevinPoland
4PeterNoX
Sheet1
Cell Formulas
RangeFormula
H2:H3H2=FILTER(Table1[Name],Table1[Age 20-25]="Yes")
I2:J2,I3I2=TOROW(IF(FILTER(Table1[[Belgium]:[Tanzania]],Table1[Name]=H2)="X",Table1[[#Headers],[Belgium]:[Tanzania]],1/0),2)
Dynamic array formulas.
The empty cells will show number 5 and the one marked with an x show number 45...
Sheet 2:
Name
BelgiumGermanyItaly
Thomas4555
Kevin555
 
Upvote 0
How about?:
(you'll have to extend to the full range of your data)

Libro1
ABCDEFG
1NameBelgiumGermanyItalyPolandTanzaniaUSA
2ThomasXXXX
3AnnaXX
4BillXX
5
6
7NameCountrys visited
8ThomasBelgiumPolandTanzaniaUSA
9AnnaGermanyItaly
10BillPolandTanzania
Hoja1
Cell Formulas
RangeFormula
C8:F8,C9:D10C8=FILTER($B$1:$G$1,FILTER($B$2:$G$4,$A$2:$A$4=B8)="X")
Dynamic array formulas.
#N/A as response
 
Upvote 0
The empty cells will show number 5 and the one marked with an x show number 45...
I don't understand what you are asking, originally you wanted to return the name of the countries.
 
Upvote 0
I don't understand what you are asking, originally you wanted to return the name of the countries.
When I enter your formula I don't return the countries but the cells are filled with number like in my previous response
 
Upvote 0
Are you saying that you don't get the names of the countries with the formula I suggested?
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,171
Members
452,615
Latest member
bogeys2birdies

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