Count query

BrutalLogiC

Active Member
Joined
Feb 26, 2006
Messages
267
Office Version
  1. 2016
Platform
  1. Windows
Hi there

I want to count the number of purchase orders that total more than £1,000

Column A is the list of purchase orders
Column B is the description
Column C is the cost

The problem for me is for each purchase order there might be more than one line item, e.g.
PO999, description = 2 hours labour, cost = £800
PO999, description = 10 widgets, cost = £500

So overall PO 999 is more than £1,000 so I can't just count the number of values over £1,000 in column C as it is not clever enough to take into account multiple rows.

Help please with a formula that can handle this.

Hope that's clear!

Thanks
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi,

Would I be able to show the value of orders within the given range rather than display the number of orders between a given range?

Somehow modify the =SUMPRODUCT(--(SUMIF($A$2:$A$11,$A$2:$A$11,$C$2:$C$11)>1000),--(SUMIF($A$2:$A$11,$A$2:$A$11,$C$2:$C$11)<1150),--(MATCH(A2:A11,A2:A11,0)=ROW(A2:A11)-ROW(A2)+1)) formula??

In the very first example where it shows 3 orders over £1,000, I would like to modify this to show the total value of those 3 orders. Not sure if this is complex and needs a new thread!
 
Upvote 0
Is there a compelling reason why you don't create a total range and inquire that range faor the queries you have?

Order#DescriptionValueTotal
1desc1600600
2desc212001200
3desc34001050
3desc4650
4desc55001100
4desc6600
5desc710001000
6desc83001200
6desc9500
6desc10400

<COLGROUP><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 79pt; mso-width-source: userset; mso-width-alt: 3726" width=105><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 53pt; mso-width-source: userset; mso-width-alt: 2503" width=70><TBODY>
</TBODY>

D2, copied down:

=IF(ISNA(VLOOKUP(A2,$A1:$D1,4,0)),SUMIF($A$2:$A$11,$A2,$C$2:$C$11),"")
 
Upvote 0
Thanks for reply. If there is an easier way of doing it I'm all for that, not sure what you mean by creating a total range and inquire that range, is this some sort of standard function?
 
Upvote 0
Upvote 0
I think the problem with this is each purchase order may have more than one line item and this won't be clever enough to take that into account?
if A1 is order number 111 and is for £500 and A2 is also order number 111 and is for £750
Then order 111 is over £1,000 but I can't just count the rows over £1,000 as it would miss order 111 out since neither of the individual line items are over £1,000
 
Upvote 0
I think the problem with this is each purchase order may have more than one line item and this won't be clever enough to take that into account?
if A1 is order number 111 and is for £500 and A2 is also order number 111 and is for £750
Then order 111 is over £1,000 but I can't just count the rows over £1,000 as it would miss order 111 out since neither of the individual line items are over £1,000

Apparently I'm misunderstanding and bloating the thread unwillingly... I apologize. Just for the record, given the data in A1:C11, the headers included:

Order#
Value
1
600
2
1200
3
400
3
650
4
500
4
600
5
1000
6
300
6
500
6
400

<TBODY>
</TBODY>

What are your queries along with the actual results thet yo want to see?
 
Upvote 0
Please look at this screen shot
http://i.imgur.com/vi0aDAv.png
In cell F6 I want to calculate the total £cost of the 6 orders between £1001 and £1500

In the above example there are 6 orders. Some of the orders have multiple line items, e.g. orders 3, 4 and 6. This complicates things for me.

The total order values are:
Order 1 = £600
Order 2 = £1,200
Order 3 = £1,050
Order 4 = £1,100
Order 5 = £1,000
Order 6 = £1,200

I was originally looking for a formula to count the number of orders between a certain range, e.g. there are 4 orders over £1,000.

I am now looking for a formula that will sum the total of the orders in a given range, e.g. the sum of orders between £1,000 and £1,100 will be £3,150 (the total of orders 3, 4 and 5).
 
Upvote 0
Please look at this screen shot
http://i.imgur.com/vi0aDAv.png
In cell F6 I want to calculate the total £cost of the 6 orders between £1001 and £1500

In the above example there are 6 orders. Some of the orders have multiple line items, e.g. orders 3, 4 and 6. This complicates things for me.

The total order values are:
Order 1 = £600
Order 2 = £1,200
Order 3 = £1,050
Order 4 = £1,100
Order 5 = £1,000
Order 6 = £1,200

I was originally looking for a formula to count the number of orders between a certain range, e.g. there are 4 orders over £1,000.

I am now looking for a formula that will sum the total of the orders in a given range, e.g. the sum of orders between £1,000 and £1,100 will be £3,150 (the total of orders 3, 4 and 5).

Would you post that sample here? An image is not readable into Excel cells...
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,721
Members
449,465
Latest member
TAKLAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top