#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Count formula

Hi All,

I have the following data:

Product Month
A 1
B 1
C 1
A 2
B 3
A 4
B 7
C 2
D 3
B 1
C 2
D 9

Could you please provide me the formula to count A, B, C, and D with below
conditions:
<2 months 2 - 6 months 6 months
A count= ? ? ?
B ? ? ?
C ? ? ?
D ? ? ?

Thanks & regards,


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Count formula


Ryan L.,

See the attached workbook "SUMPRODUCT - Count formula - Ryan L -
SDG.xls".


Have a great day,
Stan


+-------------------------------------------------------------------+
|Filename: SUMPRODUCT - Count formula - Ryan L - SDG.xls |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=176|
+-------------------------------------------------------------------+

--
stanleydgromjr
------------------------------------------------------------------------
stanleydgromjr's Profile: http://www.thecodecage.com/forumz/member.php?userid=503
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=115660

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Count formula

In order to use a single formula that can be copied you need to create some
meaningful column headers that can be referenced by the formula.

I assume that month is the month number where 1 = Jan and 12 = Dec.

Let's assume your data is in the range A2:B13 and there are no empty cells
in B2::B13.

Enter these column headers for the table:

E1:G1 = 0,2,7
E2:G2 = 1,6,12

D3:D6 = A,B,C,D

Enter this formula in E3:

=SUMPRODUCT(--($A$2:$A$13=$D3),--($B$2:$B$13=E$1),--($B$2:$B$13<=E$2))

Copy across to G3 then down to E6:G6.

--
Biff
Microsoft Excel MVP


"Ryan L." <Ryan wrote in message
...
Hi All,

I have the following data:

Product Month
A 1
B 1
C 1
A 2
B 3
A 4
B 7
C 2
D 3
B 1
C 2
D 9

Could you please provide me the formula to count A, B, C, and D with below
conditions:
<2 months 2 - 6 months 6 months
A count= ? ? ?
B ? ? ?
C ? ? ?
D ? ? ?

Thanks & regards,




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Count formula

Few thoughts..

--Do you have a space at the beginning ot the cell content or a Tab which
force the data to the next line.
--Does FormatCellsAlignmentText Alignment help..

If this post helps click Yes
---------------
Jacob Skaria


"Ryan L." wrote:

Hi All,

I have the following data:

Product Month
A 1
B 1
C 1
A 2
B 3
A 4
B 7
C 2
D 3
B 1
C 2
D 9

Could you please provide me the formula to count A, B, C, and D with below
conditions:
<2 months 2 - 6 months 6 months
A count= ? ? ?
B ? ? ?
C ? ? ?
D ? ? ?

Thanks & regards,


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Count formula

Sorry guys, please ignore the previous post; it was meant for another thread.

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Few thoughts..

--Do you have a space at the beginning ot the cell content or a Tab which
force the data to the next line.
--Does FormatCellsAlignmentText Alignment help..

If this post helps click Yes
---------------
Jacob Skaria


"Ryan L." wrote:

Hi All,

I have the following data:

Product Month
A 1
B 1
C 1
A 2
B 3
A 4
B 7
C 2
D 3
B 1
C 2
D 9

Could you please provide me the formula to count A, B, C, and D with below
conditions:
<2 months 2 - 6 months 6 months
A count= ? ? ?
B ? ? ?
C ? ? ?
D ? ? ?

Thanks & regards,




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Count formula

Ryan L.

I think , you can use sumif for your request

for example
if Product is in column A and Month is in column B you should write your
formula in column c :
=SUMIF($A$1:$A$12;A1;$B$1:$B$12)

now , you can see your answer

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Count formula

Hi Biff,

Could you please explain why you have the value 0,2,7, 1,6, 12 in column
headers

Thanks & regards,

"T. Valko" wrote:

In order to use a single formula that can be copied you need to create some
meaningful column headers that can be referenced by the formula.

I assume that month is the month number where 1 = Jan and 12 = Dec.

Let's assume your data is in the range A2:B13 and there are no empty cells
in B2::B13.

Enter these column headers for the table:

E1:G1 = 0,2,7
E2:G2 = 1,6,12

D3:D6 = A,B,C,D

Enter this formula in E3:

=SUMPRODUCT(--($A$2:$A$13=$D3),--($B$2:$B$13=E$1),--($B$2:$B$13<=E$2))

Copy across to G3 then down to E6:G6.

--
Biff
Microsoft Excel MVP


"Ryan L." <Ryan wrote in message
...
Hi All,

I have the following data:

Product Month
A 1
B 1
C 1
A 2
B 3
A 4
B 7
C 2
D 3
B 1
C 2
D 9

Could you please provide me the formula to count A, B, C, and D with below
conditions:
<2 months 2 - 6 months 6 months
A count= ? ? ?
B ? ? ?
C ? ? ?
D ? ? ?

Thanks & regards,





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Count formula

The column headers a

0...2...7
1...6...12

You said these are your conditions:

<2 months 2 - 6 months 6 months


Less than 2 months
From 2 to 6 months
Greater than 6 months

In order to use a *single* formula that can be copied you need to translate
these conditions:

<2 months 2 - 6 months 6 months


Into something that can be used in a formula. That's what my suggested
headers do. Since the middle condition is from 2 to 6 months, which is 2
separate criteria, in order for the formula to work then also you need 2
separate criteria for the other conditions, <2 and 6.

If these numbers represent month numbers then <2 can be interpreted to mean
=0 and <=1. 6 can be interpreted to mean =7 and <=12. This way each

condition has 2 criteria to test for and we can use a single formula and
copy it.


--
Biff
Microsoft Excel MVP


"Ryan L." wrote in message
...
Hi Biff,

Could you please explain why you have the value 0,2,7, 1,6, 12 in column
headers

Thanks & regards,

"T. Valko" wrote:

In order to use a single formula that can be copied you need to create
some
meaningful column headers that can be referenced by the formula.

I assume that month is the month number where 1 = Jan and 12 = Dec.

Let's assume your data is in the range A2:B13 and there are no empty
cells
in B2::B13.

Enter these column headers for the table:

E1:G1 = 0,2,7
E2:G2 = 1,6,12

D3:D6 = A,B,C,D

Enter this formula in E3:

=SUMPRODUCT(--($A$2:$A$13=$D3),--($B$2:$B$13=E$1),--($B$2:$B$13<=E$2))

Copy across to G3 then down to E6:G6.

--
Biff
Microsoft Excel MVP


"Ryan L." <Ryan wrote in message
...
Hi All,

I have the following data:

Product Month
A 1
B 1
C 1
A 2
B 3
A 4
B 7
C 2
D 3
B 1
C 2
D 9

Could you please provide me the formula to count A, B, C, and D with
below
conditions:
<2 months 2 - 6 months 6 months
A count= ? ? ?
B ? ? ?
C ? ? ?
D ? ? ?

Thanks & regards,







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
Count Formula - Count Ticks LittleAnn Excel Discussion (Misc queries) 3 May 8th 23 07:44 PM
Count Formula alish Excel Discussion (Misc queries) 5 June 10th 08 08:58 PM
is there a formula to count something like this.... driller Excel Worksheet Functions 3 July 6th 07 07:16 PM
Trying to construct a count count formula Chris K Excel Discussion (Misc queries) 6 May 26th 07 07:20 PM
a count formula TMF in MN Excel Worksheet Functions 3 August 14th 06 08:53 PM


All times are GMT +1. The time now is 11:28 PM.

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"