Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default counting "="

Is there a way to make something like =countif($a$1:$a$100,"=") work as
intended?

The function is returning zero when there are clearly cells with the text
"=" in it. If i were to use something like $a:$a as the range, it will just
count all the blank cells in column A.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 563
Default counting "="

Try =COUNTIF(A:A,"*=*")
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"rockhammer" wrote in message
...
Is there a way to make something like =countif($a$1:$a$100,"=") work as
intended?

The function is returning zero when there are clearly cells with the text
"=" in it. If i were to use something like $a:$a as the range, it will
just
count all the blank cells in column A.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default counting "="

I think it's because the = sign is not text but part of the formula.
Although I also can't get it to work when I make it text. However, this code
does work:

Dim Counter, c
Counter = 0
For Each c In Selection

If c.Formula Like "*=*" Then
Counter = Counter + 1
End If

Next c

MsgBox (Counter)

So VBA can handle it at least. My code assumes you select your range and
want output to a message box, but you could change it to be a pre-determined
range and put the result in a cell. I don't understand why the Excel
function doesn't work on an = sign as a string, but I am not surprised it
doesn't work when its part of a formula because then it's not part of the
value of the cell. And I know that Excel functions don't seem to have a
contains or like feature, which VBA does have.

Hope this helps.

Keith

"rockhammer" wrote:

Is there a way to make something like =countif($a$1:$a$100,"=") work as
intended?

The function is returning zero when there are clearly cells with the text
"=" in it. If i were to use something like $a:$a as the range, it will just
count all the blank cells in column A.

Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default counting "="

It just occured to me that you may want to distinguish between cells with =
in the formula and cells with = in the value. If you only want cells with =
in the value you could change the code in my previous post from

c.Formula Like "*=*" to
c.Value Like "*=*"

Keith


"rockhammer" wrote:

Is there a way to make something like =countif($a$1:$a$100,"=") work as
intended?

The function is returning zero when there are clearly cells with the text
"=" in it. If i were to use something like $a:$a as the range, it will just
count all the blank cells in column A.

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default counting "="

Thanks, Keith & Bernard.

*=* is perfect since I'd like to avoid macros and I've verified that it works.



"Bernard Liengme" wrote:

Try =COUNTIF(A:A,"*=*")
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"rockhammer" wrote in message
...
Is there a way to make something like =countif($a$1:$a$100,"=") work as
intended?

The function is returning zero when there are clearly cells with the text
"=" in it. If i were to use something like $a:$a as the range, it will
just
count all the blank cells in column A.

Thanks.


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting the occurrence of "Y" & "N" in Excel 2007 Christi Excel Worksheet Functions 5 October 14th 08 08:24 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"