How do I search a row for a specific text and return with the column it is in, as in this example

bilalsana

New Member
Joined
Oct 12, 2020
Messages
12
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
I have a sheet for distributing fruits based on the date, making sure they are not repeated in the different halls on the same date, as seen in the picture, I want to see the table below so that I know where that fruit is being served on that day. Importantly the new table would be in Sheet2 (unlike in the example)
tables.jpg
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
No problem, but post whole expected result not a part only and source data also
 
Upvote 0
source:
Jan-02 and Dinning 2 contain Pear, Apple, Mango
Result
Jan-02 contain Pear for Dinning 2 only
 
Upvote 0
Book1.xlsx
B
9Dinning 1
Sheet1
Cell Formulas
RangeFormula
B9B9=TEXTJOIN(", ",TRUE,IF($A$2:$A$4=B$8,IF($B$2:$F$4=$A9,$B$1:$F$1,""),""))


Anyywas, here is my solution but it breaks with comma seperated values
 
Upvote 0
Book1.xlsx
ABCDEF
1Dinning 1Dinning 2Dinning 35Dinning 4
2Jan-01ApplePearPeachMango
3Jan-02BananaPear, Apple MangoPeachAppleMango
4Jan-03PearBananaPeachMangoApple
5
6
7
8Jan-01Jan-02Jan-03
9AppleDinning 15Dinning 4
10Banana 
11PearDinning 3
12Peach
13Mango
Sheet1
Cell Formulas
RangeFormula
C9:D9,B9:B11C9=TEXTJOIN(", ",TRUE,IF($A$2:$A$4=C$8,IF($B$2:$F$4=$A9,$B$1:$F$1,""),""))
 
Upvote 0
create expected result manually
or choose one
sourceResult1
DateDinning 1Dinning 2Dinning 3Dinning 4Fruit01/01/200101/01/200201/01/2003
01/01/2001AppleBananaPear, Peach, PlumMangoAppleDinning 1Dinning 4
01/01/2002BananaPearPeach, Plum, AppleMangoBananaDinning 2Dinning 1Dinning 2
01/01/2003PearBananaPeach, MangoAppleMangoDinning 4Dinning 4
Peach, MangoDinning 3
Peach, Plum, AppleDinning 3
PearDinning 2Dinning 1
Pear, Peach, PlumDinning 3
Result2
Fruit01/01/200101/01/200201/01/2003
AppleDinning 1Dinning 3Dinning 4
BananaDinning 2Dinning 1Dinning 2
MangoDinning 4Dinning 4Dinning 3
PeachDinning 3Dinning 3Dinning 3
PearDinning 3Dinning 2Dinning 1
PlumDinning 3Dinning 3
 
Upvote 0
Is this what you are trying to achieve?

bilalsana.xlsm
ABCDEF
1Dinning 1Dinning 2Dinning 3Dinning 4Dinning 5
2Jan-01ApplePearPeachMango
3Jan-02BananaPear, Apple MangoPeachAppleMango
4Jan-03PearBananaPeachMangoApple
5
6
7
8Jan-01Jan-02Jan-03
9AppleDinning 1Dinning 2, Dinning 4Dinning 5
10Banana Dinning 1Dinning 2
11PearDinning 3Dinning 2Dinning 1
12PeachDinning 4Dinning 3Dinning 3
13MangoDinning 5Dinning 2, Dinning 5Dinning 4
Sheet1
Cell Formulas
RangeFormula
B9:D13B9=TEXTJOIN(", ",1,FILTER($B$1:$F$1,ISNUMBER(SEARCH(" "&$A9&" ",INDEX(SUBSTITUTE(" "&$B$2:$F$4&" ",","," "),MATCH(B$8,$A$2:$A$4,0),0))),""))
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,013
Members
448,935
Latest member
ijat

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