ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   if(A10="test"1,0) (https://www.excelbanter.com/excel-discussion-misc-queries/37977-if-a10%3D%22test%221-0-a.html)

jpjsmith

if(A10="test"1,0)
 
In a conditional statement is there any way to use some sort of "Like"
instead of just =, !=, ? I have a column with values similar to
value=10, value=12, value=50. Is there any way to count the number of
occurrences of "value"? The =if(A1="value",1,0) doesn't work because
its looking at the entire cell value, what I'd like is some sort of
=if(A10 LIKE "value,1,0) is this possible?


Dave Peterson

=IF(ISNUMBER(SEARCH("value",A1)),1,0)
or
=if(countif(a1,"*value*")0,1,0)

You could also just use:
=countif(a1:a10,"*value*")

To look for value in a1:a10

or maybe...
=countif(a1:a10,"value*")
to count those cells that Start with "value".




jpjsmith wrote:

In a conditional statement is there any way to use some sort of "Like"
instead of just =, !=, ? I have a column with values similar to
value=10, value=12, value=50. Is there any way to count the number of
occurrences of "value"? The =if(A1="value",1,0) doesn't work because
its looking at the entire cell value, what I'd like is some sort of
=if(A10 LIKE "value,1,0) is this possible?


--

Dave Peterson


All times are GMT +1. The time now is 03:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com