• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

How to place an X in a cell if the previous has Y or Z or T in MS Excel

Hello,

I want to place an X in cell B if cell A has text abc OR acb OR fgr.

I have have hunted high and low for a formula for this, but could find it.

Ho do you do that with a formula?

Thanks!
0
Brejinski
Asked:
Brejinski
  • 3
  • 3
  • 2
  • +1
1 Solution
 
Steven HarrisPresidentCommented:
Combine the IF OR functions:

=IF(OR(A1="abc", A1="acb", A1="fgr"), "X", "")
0
 
BrejinskiAuthor Commented:
Thanks, ThinkSpaceSolutions, but let me try to be clearer: in fact the text in cell A has a lot of other texts. It's like this: fddgdgdgdf abc fdfdf.
0
 
AlanConsultantCommented:
Hi,

One way:

B1=IF(ISERR(FIND("abc",A1))+ISERR(FIND("acb",A1))+ISERR(FIND("fgr",A1))<3,"X","")

If you add more strings to look for, increase the '3' to '4' or however many you include.

FIND is case-sensitive, so use SEARCH instead if you want non-case-sensitive.

HTH,

Alan.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
barry houdiniCommented:
Try using SEARCH like this

=IF(COUNT(SEARCH({"abc","acb","fgr"},A1)),"X","")

As Alan says, SEARCH is not case-sensitive. if you want case-sensitivity switch to FIND

regards, barry
0
 
AlanConsultantCommented:
Barry's is better :-)

But do note the case-sensitive thing on FIND vs SEARCH.

Thanks,

Alan.
0
 
Steven HarrisPresidentCommented:
Nice one Barry.
0
 
BrejinskiAuthor Commented:
Still not working for me... Maybe because my Excel has another language. I am uploading the worksheet here to see if you guys can help a little bit more.

The "sentences" are in column A and the words I am searching in it are "Corsa" OR "Classic" OR "Celta".
18-COMPRA.xlsm
0
 
barry houdiniCommented:
So I put this version in B2 copied down

=IF(COUNT(SEARCH({"Corsa","Classic","Celta"},A2)),"X","")

see attached

regards, barry
18-COMPRA-barry.xlsm
0
 
BrejinskiAuthor Commented:
Great! Thank you very much!
0
 
AlanConsultantCommented:
{Ignore - Posted in error}
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now