Solved

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

Posted on 2013-10-23
10
411 Views
Last Modified: 2013-10-23
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
Comment
Question by:Brejinski
  • 3
  • 3
  • 2
  • +1
10 Comments
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39595701
Combine the IF OR functions:

=IF(OR(A1="abc", A1="acb", A1="fgr"), "X", "")
0
 

Author Comment

by:Brejinski
ID: 39595713
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
 
LVL 12

Expert Comment

by:Alan3285
ID: 39595721
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 50

Expert Comment

by:barry houdini
ID: 39595726
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
 
LVL 12

Expert Comment

by:Alan3285
ID: 39595731
Barry's is better :-)

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

Thanks,

Alan.
0
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39595746
Nice one Barry.
0
 

Author Comment

by:Brejinski
ID: 39595795
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
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 39595813
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
 

Author Closing Comment

by:Brejinski
ID: 39595816
Great! Thank you very much!
0
 
LVL 12

Expert Comment

by:Alan3285
ID: 39595829
{Ignore - Posted in error}
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Getting error in connectionstring with Excel. 30 35
Manipulate Range in Excel VBA 6 24
microsoft word short cuts 3 38
Need excel formula correction. 5 14
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question