Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Vic Vic is offline
external usenet poster
 
Posts: 117
Default COUNTIF - Summing non-numerical items in cells

I have a business in which I need to sum the number of deliveries received on
the various days of each month. Sometimes item X is delivered and sometimes
item Y. To sum the deliveries of item X received in, say, January, I use the
formula =COUNTIF(A1:A31,"*X*") [where cells A1 to A31 cover the 31 days of
the month] and, for item Y, =COUNTIF(A1:A31,"*Y*"). If I receive deliveries
of both X and Y on the same day there is no problem €“ I can enter both X and
Y in a cell and those two formulas will still work. However, occasionally I
receive two deliveries per day of item X. But if I enter two Xs in the same
cell, Excel treats it as only one. How do I get the program to count them
both?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default COUNTIF - Summing non-numerical items in cells

Vic,

Try this with the item you counting in B1

=SUMPRODUCT((LEN(A1:A31))-(LEN(SUBSTITUTE(UPPER(A1:A31),UPPER(B1),""))))/LEN(B1)

Mike

"Vic" wrote:

I have a business in which I need to sum the number of deliveries received on
the various days of each month. Sometimes item X is delivered and sometimes
item Y. To sum the deliveries of item X received in, say, January, I use the
formula =COUNTIF(A1:A31,"*X*") [where cells A1 to A31 cover the 31 days of
the month] and, for item Y, =COUNTIF(A1:A31,"*Y*"). If I receive deliveries
of both X and Y on the same day there is no problem €“ I can enter both X and
Y in a cell and those two formulas will still work. However, occasionally I
receive two deliveries per day of item X. But if I enter two Xs in the same
cell, Excel treats it as only one. How do I get the program to count them
both?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default COUNTIF - Summing non-numerical items in cells

Hi,

On reflection this may be more complicated than my formula will cope with.
If for example you have "Widgets" in b1 (no quotes) then the formula works
fine if you have several entries in column A like

A box of widgets
A pallet of widgets

But it won't work for a search of 2 different items. Lets wait and see if
someone solves this multi item search with a formula.

Mike

"Mike H" wrote:

Vic,

Try this with the item you counting in B1

=SUMPRODUCT((LEN(A1:A31))-(LEN(SUBSTITUTE(UPPER(A1:A31),UPPER(B1),""))))/LEN(B1)

Mike

"Vic" wrote:

I have a business in which I need to sum the number of deliveries received on
the various days of each month. Sometimes item X is delivered and sometimes
item Y. To sum the deliveries of item X received in, say, January, I use the
formula =COUNTIF(A1:A31,"*X*") [where cells A1 to A31 cover the 31 days of
the month] and, for item Y, =COUNTIF(A1:A31,"*Y*"). If I receive deliveries
of both X and Y on the same day there is no problem €“ I can enter both X and
Y in a cell and those two formulas will still work. However, occasionally I
receive two deliveries per day of item X. But if I enter two Xs in the same
cell, Excel treats it as only one. How do I get the program to count them
both?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 989
Default COUNTIF - Summing non-numerical items in cells

I don't know if there is a better way but i would suggest this, using your
example:

=COUNTIF(A38:A53,"*X*")+COUNTIF(A38:A53,"*XX*")

it is simple, simpleminded?, but it does work.

"Vic" wrote:

I have a business in which I need to sum the number of deliveries received on
the various days of each month. Sometimes item X is delivered and sometimes
item Y. To sum the deliveries of item X received in, say, January, I use the
formula =COUNTIF(A1:A31,"*X*") [where cells A1 to A31 cover the 31 days of
the month] and, for item Y, =COUNTIF(A1:A31,"*Y*"). If I receive deliveries
of both X and Y on the same day there is no problem €“ I can enter both X and
Y in a cell and those two formulas will still work. However, occasionally I
receive two deliveries per day of item X. But if I enter two Xs in the same
cell, Excel treats it as only one. How do I get the program to count them
both?

  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default COUNTIF - Summing non-numerical items in cells

Hi,

In a spare column (say column D), use the following array formula
(Ctrl+Shift+Enter)

=IF(LEFT(D7)="X",COUNTA(MID(D7,ROW(INDIRECT("1:"&L EN(D7))),1)),0)

In another spare column (say column E), use the following array formula
(Ctrl+Shift+Enter)

=IF(LEFT(D7)="Y",COUNTA(MID(D7,ROW(INDIRECT("1:"&L EN(D7))),1)),0)

Now you can sum up column D for X's and column E for Y;s

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Vic" wrote in message
...
I have a business in which I need to sum the number of deliveries received
on
the various days of each month. Sometimes item X is delivered and
sometimes
item Y. To sum the deliveries of item X received in, say, January, I use
the
formula =COUNTIF(A1:A31,"*X*") [where cells A1 to A31 cover the 31 days of
the month] and, for item Y, =COUNTIF(A1:A31,"*Y*"). If I receive
deliveries
of both X and Y on the same day there is no problem €“ I can enter both X
and
Y in a cell and those two formulas will still work. However, occasionally
I
receive two deliveries per day of item X. But if I enter two Xs in the
same
cell, Excel treats it as only one. How do I get the program to count them
both?


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
Summing mulitple line items within date ranges wenb Excel Worksheet Functions 1 June 19th 08 05:59 PM
syntax for countif when cells fall within a numerical range Tom L Excel Worksheet Functions 5 May 31st 08 03:22 AM
Help...Summing Items Scattered in a list modicon2 Excel Discussion (Misc queries) 1 August 21st 06 04:39 PM
Selective summing of table items? John Excel Worksheet Functions 2 January 6th 06 10:47 PM
Conditional Summing (Sumif? Countif?) klam Excel Worksheet Functions 2 August 8th 05 07:39 PM


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