Return Text if certain criteria is met

patrickteo91

Board Regular
Joined
Sep 12, 2012
Messages
88
Hi,

I need an excel formula to return a text (Conclusion) if a word is found in either in column K or column M.
Criteria is, if a mixture of Honda and Volvo, to display Honda only. But if both Volvo or both Honda is present, can directly display Volvo or Honda respectively.

Type AType BConclusion ?
HondaVolvoHonda
VolvoHondaHonda
VolvoVolvoVolvo
HondaHondaHonda
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Not entirely clear but would this satisfy your requirement?

20 07 06.xlsm
KLMN
1Type AType BConclusion ?
2HondaVolvoHonda
3VolvoHondaHonda
4VolvoVolvoVolvo
5HondaHondaHonda
Honda Volvo
Cell Formulas
RangeFormula
N2:N5N2=IF(COUNTIF(K2:M2,"Honda"),"Honda","Volvo")
 
Upvote 0
@Peter_SSs Just out of interest, why add the COUNTIF? Wouldn't it be a little simpler with just =IF(M2="Honda","Honda","Volvo")?
No, with the sample data that would return Volvo for row 2 when the correct result is Honda
 
Upvote 0
Sorry, Wrong column, I meant K2 not M2 =IF(K2="Honda","Honda","Volvo")?

Just wondering why you added the Countif,
 
Upvote 0
thanks for the explanation
You're welcome.

In case Honda might also be possible in column L where presumably it should be ignored, another option would be
=IF(OR(K2="Honda",M2="Honda"),"Honda","Volvo")
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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