Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")

How would I create this function to do a Count If the left character in a
range of cells is an "A"?

COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")



Thank you.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KL KL is offline
external usenet poster
 
Posts: 201
Default COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")

COUNTIF('SpreadSheet1!A1:A25,"A*")

--
KL
[MVP - Microsoft Excel]
RU: http://www.mvps.ru/Program/Default.aspx
ES: http://mvp.support.microsoft.com/?LN=es-es
EN: http://mvp.support.microsoft.com/?LN=en-us
Profile: https://mvp.support.microsoft.com/pr...A-9E6C73C09A36


"Dorian C. Chalom" wrote in message ...
How would I create this function to do a Count If the left character in a
range of cells is an "A"?

COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")



Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")

=SUMPRODUCT(--(LEFT('SpreadSheet1!A1:A25, 1)="A"))


"Dorian C. Chalom" wrote:

How would I create this function to do a Count If the left character in a
range of cells is an "A"?

COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")



Thank you.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")

Thanks that did the trick...

"KL" wrote in message
...
COUNTIF('SpreadSheet1!A1:A25,"A*")

--
KL
[MVP - Microsoft Excel]
RU: http://www.mvps.ru/Program/Default.aspx
ES: http://mvp.support.microsoft.com/?LN=es-es
EN: http://mvp.support.microsoft.com/?LN=en-us
Profile:
https://mvp.support.microsoft.com/pr...A-9E6C73C09A36


"Dorian C. Chalom" wrote in message
...
How would I create this function to do a Count If the left character in a
range of cells is an "A"?

COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")



Thank you.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")

I like COUNTIF but don't include the ' in front of the sheet name.

You can eliminate the sheet reference alltogether if you name the range, for
example suppose I name it D for data. Then here are some of your possible
formulas:

=COUNTIF(D,"a*")
=SUMPRODUCT(N(LEFT(D)="a"))
=SUM(N(LEFT(D)="a")) entered as an array

Note since you are looking for the first character you don't need to specify
the second argument of the LEFT function. Also, although it is in vogue to
use -- to convert TRUE,FALSE to 1,0 N is shorter in this case.

Note also that none of these formulas are case sensitive, but you can do a
case sensitive version.
--
Cheers,
Shane Devenshire


"KL" wrote:

COUNTIF('SpreadSheet1!A1:A25,"A*")

--
KL
[MVP - Microsoft Excel]
RU: http://www.mvps.ru/Program/Default.aspx
ES: http://mvp.support.microsoft.com/?LN=es-es
EN: http://mvp.support.microsoft.com/?LN=en-us
Profile: https://mvp.support.microsoft.com/pr...A-9E6C73C09A36


"Dorian C. Chalom" wrote in message ...
How would I create this function to do a Count If the left character in a
range of cells is an "A"?

COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")



Thank you.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KL KL is offline
external usenet poster
 
Posts: 201
Default COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")

"ShaneDevenshire" wrote

I like COUNTIF but don't include the ' in front of the sheet name.


I guess that's an obvious missprint deserving no comments :-)

=SUMPRODUCT(N(LEFT(D)="a"))


The subtle difference is that the SUMPRODUCT formula is about 12 times slower than the COUNTIF one in 5000 cells ;-)

=SUM(N(LEFT(D)="a")) entered as an array


This one is even slower than SUMPRODUCT, although the gap is far less significant

Also, although it is in vogue to
use -- to convert TRUE,FALSE to 1,0 N is shorter in this case.


It is shorter to write, but seems to be slightly slower to calculate (according to C.Williams' plug-in)

Regards,
KL
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default COUNTIF(LEFT('SpreadSheet1!A1:A25, 1), "A")

Hi KL,

It wasn't a typo on your part, it was in the original question.

The most important point in my comment is that of using range names.

And like I said COUNTIF is the approach of choice.

On average array entered formulas are about 1.1 - 1.2 times slower than
SUMPRODUCT although the files size may be greater for the latter. Most
people are more interested in speed, not file size.

--
Cheers,
Shane Devenshire


"KL" wrote:

"ShaneDevenshire" wrote

I like COUNTIF but don't include the ' in front of the sheet name.


I guess that's an obvious missprint deserving no comments :-)

=SUMPRODUCT(N(LEFT(D)="a"))


The subtle difference is that the SUMPRODUCT formula is about 12 times slower than the COUNTIF one in 5000 cells ;-)

=SUM(N(LEFT(D)="a")) entered as an array


This one is even slower than SUMPRODUCT, although the gap is far less significant

Also, although it is in vogue to
use -- to convert TRUE,FALSE to 1,0 N is shorter in this case.


It is shorter to write, but seems to be slightly slower to calculate (according to C.Williams' plug-in)

Regards,
KL

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
excel "hides" the numbercolumn (the one on the far left) Jens Outzen Excel Discussion (Misc queries) 2 July 24th 06 09:40 AM
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
how do I "freeze" the left hand title column DDAANN Setting up and Configuration of Excel 4 February 26th 06 12:21 PM
Help Spreadsheet1.ActiveSheet.Range("B1").LoadText debugging qa4ever Charts and Charting in Excel 0 January 2nd 06 09:52 PM


All times are GMT +1. The time now is 05:05 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"