Sahitya

New Member
Joined
May 29, 2018
Messages
27
I have to change the name as per the group in 'Type' column. it is working fine if it is represented as single name, but not with multiple names.

Eg., For Apple, Orange, Watermelon, it should come as Medium, Soft

Formula used in 'Type' Column -

=IF(OR([@Names]="Orange",[@Names]="Watermelon",[@Names]="Banana"),"Soft",IF([@Names]="Apple","Medium",
IF([@Names]="Pineapple","Hard",
"Check Names")))

NamesType
OrangeSoft
PineappleHard
Apple, Orange, WatermelonCheck Names
OrangeSoft
BananaSoft
Watermelon, PineappleCheck Names

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
i will be taking dump from sharepoint and which has fruit names which are true or false. With your help i used textjoin to concatenate the 'Names' column.

Problem here is everytime i refresh the dump, data keeps varying and also i will be creating some more validations and from this sheet pivot will be called.:(

is there any other which will help without having a seperate table


AppleOrangeBananaWatermelonPineappleNamesType
FALSETRUEFALSEFALSEFALSEOrangeSoft
FALSEFALSEFALSEFALSETRUEPineappleHard
TRUETRUEFALSETRUEFALSEApple, Orange, WatermelonCheck Names
FALSETRUEFALSEFALSEFALSEOrangeSoft
FALSEFALSETRUEFALSEFALSEBananaSoft
FALSEFALSEFALSETRUETRUEWatermelon, PineappleCheck Names

<colgroup><col span="5"><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Book1
ABCDEFGHIJKL
1AppleOrangeBananaWatermelonPineappleNamesTypeitemtype
2FALSETRUEFALSEFALSEFALSEOrangesoftapplemedium
3FALSEFALSEFALSEFALSETRUEPineapplehardorangesoft
4TRUETRUEFALSETRUEFALSEApple, Orange, Watermelonmedium, soft, softbananasoft
5FALSETRUEFALSEFALSEFALSEOrangesoftwatermelonsoft
6FALSEFALSETRUEFALSEFALSEBananasoftpineapplehard
7FALSEFALSEFALSETRUETRUEWatermelon, Pineapplesoft, hard
Sheet1


In G2 control+shift+enter, not just enter, and copy down:

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(SEARCH(" "&$K$2:$K$6&","," "&$F2&",")),$L$2:$L$6,""))
 
Upvote 0
I will show you a simple example which can tell you whether text in one cell contains something or not:

IF(countif([@Names],"*Apple*")>0,"Medium"

if
[@Names] contains "apple", COUNTIF returns 1, otherwise COUNTIF returns 0.
 
Upvote 0
Thank you Very much, it solves the problem.

Instead of 'medium, soft, soft' can be get as 'medium, soft' without duplicating the type. :confused:

ABCDEFGHIJKL
1AppleOrangeBananaWatermelonPineappleNamesTypeitemtype
2FALSETRUEFALSEFALSEFALSEOrangesoftapplemedium
3FALSEFALSEFALSEFALSETRUEPineapplehardorangesoft
4TRUETRUEFALSETRUEFALSEApple, Orange, Watermelonmedium, soft, softbananasoft
5FALSETRUEFALSEFALSEFALSEOrangesoftwatermelonsoft
6FALSEFALSETRUEFALSEFALSEBananasoftpineapplehard
7FALSEFALSEFALSETRUETRUEWatermelon, Pineapplesoft, hard

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1



In G2 control+shift+enter, not just enter, and copy down:

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(SEARCH(" "&$K$2:$K$6&","," "&$F2&",")),$L$2:$L$6,""))
 
Upvote 0
I will show you a simple example which can tell you whether text in one cell contains something or not:

IF(countif([@Names],"*Apple*")>0,"Medium"

if
[@Names] contains "apple", COUNTIF returns 1, otherwise COUNTIF returns 0.


Will ii get concatenated names ?
 
Upvote 0
To get concatenated names, Textjoin is still need.
 
Upvote 0
Thank you Very much, it solves the problem.

Instead of 'medium, soft, soft' can be get as 'medium, soft' without duplicating the type. :confused:

In G2 control+shift+enter, not just enter, and copy down:

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(MATCH({"hard","medium","soft"},IF(ISNUMBER(SEARCH(" "&$K$2:$K$6&","," "&$F2&",")),$L$2:$L$6,""),0)),{"hard","medium","soft"},""))
 
Upvote 0
In G2 control+shift+enter, not just enter, and copy down:

=TEXTJOIN(", ",TRUE,IF(ISNUMBER(MATCH({"hard","medium","soft"},IF(ISNUMBER(SEARCH(" "&$K$2:$K$6&","," "&$F2&",")),$L$2:$L$6,""),0)),{"hard","medium","soft"},""))


You are real saviour for me. Thank you very much Mrexcel. :)
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

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