Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default COUNT based on 2 criteria

I have the formula below that sums the values in Range name
'Purchases' based on 2 criteria. How could I modify this to COUNT the
number of instances of receipts, based on the existing 2 criteria?

=(SUMPRODUCT((Store=123)*(Inventory_No=$I$6),(Purc hases))/10)

I've tried =(COUNT((StoreNo=123)*(Inventory_No=$I$6),(Purchas es))/10)
and =COUNT((SUMPRODUCT((StoreNo=123)*(Inventory_No=$I$ 6),(Purchases))/
10))

But they don't give me the correct answer
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

=SUMPRODUCT(--(Store=123),--(Inventory_No=$I$6))


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
I have the formula below that sums the values in Range name
'Purchases' based on 2 criteria. How could I modify this to COUNT the
number of instances of receipts, based on the existing 2 criteria?

=(SUMPRODUCT((Store=123)*(Inventory_No=$I$6),(Purc hases))/10)

I've tried =(COUNT((StoreNo=123)*(Inventory_No=$I$6),(Purchas es))/10)
and =COUNT((SUMPRODUCT((StoreNo=123)*(Inventory_No=$I$ 6),(Purchases))/
10))

But they don't give me the correct answer



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default COUNT based on 2 criteria

Thank you, but how would that count the number of purchases? (I've
other columns of data in my sheet also)

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

Try it and see.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
Thank you, but how would that count the number of purchases? (I've
other columns of data in my sheet also)



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default COUNT based on 2 criteria

Just tried that, answer = 7, but should be 2

If I have 10 columns of data and the range name 'Purchases' is in
Column F, how would the formula count the number of receipts, for
Store 123 and Inventory_No in I6, or am I missing something?


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

That is how that SP formula works. without seeing your data I cannot say why
you get 7 or why you think you should get 2, but assuming Store is column F,
and assuming the formula that you posted woks, this is the same, it just
doesn't multiply by the number of purchases or divide by 10.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
Just tried that, answer = 7, but should be 2

If I have 10 columns of data and the range name 'Purchases' is in
Column F, how would the formula count the number of receipts, for
Store 123 and Inventory_No in I6, or am I missing something?



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default COUNT based on 2 criteria

Bob, Store is in Column A; and Purchases in Column F

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

So that formula checks where column A = 126 and Inventory_N o = I6, pure and
simple.

Can you post an example dataset that calculates wrongly?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
Bob, Store is in Column A; and Purchases in Column F



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default COUNT based on 2 criteria

See below, answer I should get is 2 (receipts of the inventory line)

Store InvID Opening Purchases
123 16 4730 0
123 16 2900 0
123 16 2150 2500
123 16 3870 0
123 16 2950 2750
123 16 5120 0
123 16 4150 0
525 16 6500 0
525 16 4650 0
525 16 4020 0
525 16 3070 0
525 16 2220 1800
525 16 3450 1200
525 16 3880 0


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

I see why you get 7, there are 7 items where the Store is 123 and the
inventory is 16, but why do you think it should be 2?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
See below, answer I should get is 2 (receipts of the inventory line)

Store InvID Opening Purchases
123 16 4730 0
123 16 2900 0
123 16 2150 2500
123 16 3870 0
123 16 2950 2750
123 16 5120 0
123 16 4150 0
525 16 6500 0
525 16 4650 0
525 16 4020 0
525 16 3070 0
525 16 2220 1800
525 16 3450 1200
525 16 3880 0






  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default COUNT based on 2 criteria

Possibly

=SUMPRODUCT(--(Store=123)*--(InvID=16)*--(Purchases0))



Mike

" wrote:

See below, answer I should get is 2 (receipts of the inventory line)

Store InvID Opening Purchases
123 16 4730 0
123 16 2900 0
123 16 2150 2500
123 16 3870 0
123 16 2950 2750
123 16 5120 0
123 16 4150 0
525 16 6500 0
525 16 4650 0
525 16 4020 0
525 16 3070 0
525 16 2220 1800
525 16 3450 1200
525 16 3880 0



  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

Using *AND -- is totally redundant.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Mike H" wrote in message
...
Possibly

=SUMPRODUCT(--(Store=123)*--(InvID=16)*--(Purchases0))



Mike

" wrote:

See below, answer I should get is 2 (receipts of the inventory line)

Store InvID Opening Purchases
123 16 4730 0
123 16 2900 0
123 16 2150 2500
123 16 3870 0
123 16 2950 2750
123 16 5120 0
123 16 4150 0
525 16 6500 0
525 16 4650 0
525 16 4020 0
525 16 3070 0
525 16 2220 1800
525 16 3450 1200
525 16 3880 0





  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default COUNT based on 2 criteria

Thank you Mike, excatly what I need

Bob, was looking to count the number of receipts for a particular
store and inventory item. My example 2 receipts were receeived for the
data in question



  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

What made it hard was that you didn't say ... where the number of purchases
0.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
Thank you Mike, excatly what I need

Bob, was looking to count the number of receipts for a particular
store and inventory item. My example 2 receipts were receeived for the
data in question





  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNT based on 2 criteria

BTW, note my comment about redundancy

=SUMPRODUCT(--(Store=123),--(InvID=16),--(Purchases0))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
Thank you Mike, excatly what I need

Bob, was looking to count the number of receipts for a particular
store and inventory item. My example 2 receipts were receeived for the
data in question





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 based on criteria ba374 Excel Discussion (Misc queries) 1 December 20th 07 11:19 PM
Count based on multiple criteria JerryS Excel Worksheet Functions 1 October 9th 07 06:37 PM
Need to count based on different criteria in two columns Adlin Excel Worksheet Functions 3 May 25th 07 08:05 PM
Count distinct based on criteria Sune Fibaek Excel Worksheet Functions 6 April 29th 07 01:34 AM
Count or Sum based on more than 1 criteria Andrew C Excel Worksheet Functions 1 December 29th 05 09:46 PM


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