Solved

Is there a LIKE function in Excel

Posted on 2015-01-13
7
58 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
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
Comment Utility
^ 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 45

Expert Comment

by:Martin Liss
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

763 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

10 Experts available now in Live!

Get 1:1 Help Now