Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default problem (maybe simple) displaying certain text

Hi all,

This maybe a simple fix, but I cannot seem to get it.

I have a range, let's say A3:A30, each containing a 1 or 0. I would like to
have a cell show how many 1's and how many 0's in the following format:
(x-y) where x =1's and y = 0's. Any ideas?

I tried using =COUNTIF(A3:A30,"1") in a cell and =COUNTIF(A3:A30,"0") in
another, then displaying those numbers in a cell, but that didn't work
either. Any ideas?

Thanks,

Rick


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default problem (maybe simple) displaying certain text

how about this in the cell

="(" & COUNTIF(A3:A30,"1")&"- "&COUNTIF(A3:A30,"0")&")"

--


Gary


"Squalle" wrote in message
...
Hi all,

This maybe a simple fix, but I cannot seem to get it.

I have a range, let's say A3:A30, each containing a 1 or 0. I would like
to have a cell show how many 1's and how many 0's in the following format:
(x-y) where x =1's and y = 0's. Any ideas?

I tried using =COUNTIF(A3:A30,"1") in a cell and =COUNTIF(A3:A30,"0") in
another, then displaying those numbers in a cell, but that didn't work
either. Any ideas?

Thanks,

Rick


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 138
Default problem (maybe simple) displaying certain text

Basically should work.
I just tried =COUNTIF(A3:A30,1)-COUNTIF(A3:A30,0)
No problems.

Cheers,

Joerg

"Squalle" wrote in message
...
Hi all,

This maybe a simple fix, but I cannot seem to get it.

I have a range, let's say A3:A30, each containing a 1 or 0. I would like

to
have a cell show how many 1's and how many 0's in the following format:
(x-y) where x =1's and y = 0's. Any ideas?

I tried using =COUNTIF(A3:A30,"1") in a cell and =COUNTIF(A3:A30,"0") in
another, then displaying those numbers in a cell, but that didn't work
either. Any ideas?

Thanks,

Rick




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default problem (maybe simple) displaying certain text

Your formula is set to count if the string 0 or string 1 is in the cell
range

Try using =COUNTIF(A3:A30,1) and =COUNTIF(A3:A30,0)

Then subtract one from the other e.g.

=COUNTIF(A3:A30,1) - COUNTIF(A3:A30,0)


--
Cheers
Nigel



"Squalle" wrote in message
...
Hi all,

This maybe a simple fix, but I cannot seem to get it.

I have a range, let's say A3:A30, each containing a 1 or 0. I would like
to have a cell show how many 1's and how many 0's in the following format:
(x-y) where x =1's and y = 0's. Any ideas?

I tried using =COUNTIF(A3:A30,"1") in a cell and =COUNTIF(A3:A30,"0") in
another, then displaying those numbers in a cell, but that didn't work
either. Any ideas?

Thanks,

Rick



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default problem (maybe simple) displaying certain text

Thanks All,

Gary got it. It was the "&" that I was missing. I, for some reason, was
trying to use "+".
Too much PERL programming lately...

Thanks Gary!

Rick



"GKeramidas" wrote in message
...
how about this in the cell

="(" & COUNTIF(A3:A30,"1")&"- "&COUNTIF(A3:A30,"0")&")"

--


Gary


"Squalle" wrote in message
...
Hi all,

This maybe a simple fix, but I cannot seem to get it.

I have a range, let's say A3:A30, each containing a 1 or 0. I would like
to have a cell show how many 1's and how many 0's in the following
format: (x-y) where x =1's and y = 0's. Any ideas?

I tried using =COUNTIF(A3:A30,"1") in a cell and =COUNTIF(A3:A30,"0") in
another, then displaying those numbers in a cell, but that didn't work
either. Any ideas?

Thanks,

Rick




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
Sounds simple but isn't - displaying cell text pieman3 Excel Worksheet Functions 5 April 5th 09 03:58 AM
Problem displaying color mgossard Excel Discussion (Misc queries) 0 February 9th 08 05:15 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Find Text problem Sammy Excel Programming 2 January 3rd 06 11:34 PM
Problem in displaying the chart ramkumar_cpt Charts and Charting in Excel 1 November 17th 05 12:16 PM


All times are GMT +1. The time now is 09:56 PM.

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

About Us

"It's about Microsoft Excel"