Solved

Is there a LIKE function in Excel

Posted on 2015-01-13
7
59 Views
Last Modified: 2015-02-11
I have three thousand rows. In one column there is a field that in some instances contains the word "mattress". I want to see how many instances there are.
0
Comment
Question by:CMChalcraft
7 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 40546752
Use COUNTIF.

For example:

=COUNTIF(A1:A100,"mattress") to see how many cells have ONLY the word "mattress" as their values

=COUNTIF(A1:A100,"*mattress*") to see how many cells have the word "mattress" within their values, as well as potentially some other text
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40546756
find or search can find a value inside a word, e.g.

=if(iserror(SEARCH("mattress",A1)),"No","Yes")

If you want to count multiple instances, then you can use the array formula

=SUM(IF(ISERROR(SEARCH("mattress",A:A)),0,1))

and press Ctrl+Shift+Enter instead of pressing Enter (change A:A to your range).

Alternatively, do a filter on that column, and the number of instances will be in the status bar at the bottom.
0
 

Author Comment

by:CMChalcraft
ID: 40546779
Thank you. I have used =if(iserror(SEARCH("mattress",A1)),"No","Yes").

This is a spreadsheet a colleague has created and he wants to enter 1 or 0 for each matched instance. I have amended the formula to do this.

Very prompt!

Regards

Chris
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 40546793
COUNTIF does the exact same thing, without having to resort to an array formula.  Did you even try it?
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40552573
^ Best solution (COUNTIF).  No helper column needed; inserts the total in one cell; ultimately faster than having several thousand individual formulas returning 1 or 0.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40602754
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

912 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now