Formula (If cell contains text or blank....)

kismatstha

New Member
Joined
Sep 11, 2020
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
I want to create a formula in excel for following condition:

1.If the cell A2 contains something (text), Give yes otherwise no in cell B2
2.If the cell A2 contains blank, Give blank in cell B2.

I tried with If function with Isnumber and IF error but couldnt succeeded. Could somebody please help?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
maybe =IF(ISTEXT(A2),"Yes","")
 
Upvote 0
Welcome to the MrExcel board!

Possibly these? In No. 2 you didn't say what to give if A2 does not contain a blank.

=IF(A2="","no","yes")

=IF(A2="","",A2)
 
Upvote 0
Hello,
thank you fotr the quick response. :) Sorry I mislead you from the previous question. Actually I need one formula for those all conditions.

So again,
If cell A2 contains some specific text, give YES, if not then give no and if the cell A2 is blank, then give blank. I hope I dont confuse you.
 

Attachments

  • need_Formula.png
    need_Formula.png
    11 KB · Views: 179
Upvote 0
Excel Formula:
=IF(A2="","",IF(A2="specific text","yes","no"))
 
Upvote 0
Excel Formula:
=IF(A2="","",IF(A2="specific text","yes","no"))
Hello Peter,
Thank you for the help. What if one condition is added, could you please help? So again,
If the cell A2 contains something ( Redlining in my case, please see image attached), Give "yes" in cell B2 while if the cell doesn't contain that word, then give No and also
If the cell A2 contains blank or specific text ( | Final CAE in my case) Importantly | Final CAE has to exist alone in the cell not with other words in the cell) , then give blank in cell B. Please find the edited image.
 

Attachments

  • IF_multiple condtions.png
    IF_multiple condtions.png
    11.8 KB · Views: 93
Upvote 0
you can learn to do these IF takes the arguments, What do you want to test for result, TRUE or FALSE i.e.
,IF(A2="specific text","yes","no"), you learn more from trying
 
Upvote 0
See if this is it.

20 09 14.xlsm
AB
1
2| Redlining | NF no | Final CAEYes
3 
4| Clean Copy | NF yes | Final CAENo
5| Final CAE 
IF
Cell Formulas
RangeFormula
B2:B5B2=IF(OR(A2="",A2="| Final CAE"),"",IF(ISNUMBER(SEARCH("| Redlining",A2)),"Yes","No"))
 
Upvote 0
See if this is it.

20 09 14.xlsm
AB
1
2| Redlining | NF no | Final CAEYes
3 
4| Clean Copy | NF yes | Final CAENo
5| Final CAE 
IF
Cell Formulas
RangeFormula
B2:B5B2=IF(OR(A2="",A2="| Final CAE"),"",IF(ISNUMBER(SEARCH("| Redlining",A2)),"Yes","No"))
Hello Peter,
That worked perfectly. Thank you for the time and help. :)
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,606
Members
449,089
Latest member
Motoracer88

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