Range contains multiple text

bdtran

New Member
Joined
Oct 11, 2018
Messages
33
Hello All,

I need your help to create a formula to get one of three results in column A with the following scenarios.

For example within the same range $B3:$L3, if there is letter "A" found, then the result should be "VALUE-A".
In case if there are letter "A" and "B" in the same range, then the result should be "VALUE-A-B".
And if the range has all three letters, A, B and C, then the result should be "VALUE-A-B-C" as A3.

Thank you in advance.
*BDT



ABCDEFGHIJKL
1VALUE-AAAA
2VALUE-A-BABAB
3VALUE-A-B-CABCCBA

<tbody>
</tbody>
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi - this formula works with the data you supplied

In A2 copied down
=IF(COUNTIF(B2:L2,"A")=0,"",IF(COUNTIF(B2:L2,"B")=0,"A",IF(COUNTIF(B2:L2,"C")=0,"A-B","A-B-C")))
 
Last edited:
Upvote 0
Try:

=IF(COUNTA(B2:L2)>0,"VALUE"&IF(COUNTIF(B2:L2,"A")>0,"-A","")&IF(COUNTIF(B2:L2,"B")>0,"-B","")&IF(COUNTIF(B2:L2,"C")>0,"-C",""),"")
 
Upvote 0
Yongle and Phuoc,

I was able to get the exactly result I need using your formulas.

Thanks much for your help.
*BDT
 
Upvote 0

Forum statistics

Threads
1,214,857
Messages
6,121,948
Members
449,056
Latest member
FreeCricketId

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