how to filter or vlookup

Hi All,

I have a spreadsheet which contains lots of items but i want Category 1 items.

what want to do is:

In an order, if Product is more then £150 its a boiler and if it's less then £150 is an accessory.

I want to see how many orders are there in total which have Boilers and out of these orders how many have Boilers +accessories.

Can someone help please.


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fabrice LambertConsultingCommented:
Maybe use the COUNTIF or COUNTIFS function.

PS: I'm not sure the identifying product category based on the price is a wise idea.
ammartahir1978Author Commented:
Thank you Fabrice, but i have category filtered already.

all i want now is If order number has 1 product compare the value if its less then 150£ its accessories so separate that.

else if ordernumber has more then 1 product compare price and if its more then 150£ its a boiler and other product if less then 150 is accessories so this will go in bolier + accessories pot.
Ejgil HedegaardCommented:
Make a formula on sheet esprit_sale in M2 and copy down

Open in new window

For each new order number (only calculate once for each order number)
If only one order line and sell price is 150 or more, then it is boiler "B" else it is accessories "A"
Else (more than one order line) if one or more sell prices is 150 or more, it is boiler + accessories "B+A", else all are accessories "A"

Then count the numbers of B, B+A and A, using a countif function.

The orders are sorted, so to speed up the calculation the formula only use a limited number of rows below, instead of using the entire range,

There are 20309 orders
B            5165
B+A            5775
A            9369

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

ammartahir1978Author Commented:
thank you Eijgil

was this formula was run on CAT 1 all orders?
Ejgil HedegaardCommented:
I used the sheet esprit_sale where the sell price is, because sales amount on sales is a sum of the prices, so comparing price to 150 could be meaningless.
So it is all orders on sheet esprit_sale.

A similar count on sales, accepting the price problem.
Sorted on OrderNumber and Cat.
Many orders have more than one category, so to only look at Cat 1, and ignore others, the formula is

Open in new window

There are 14064 order lines with Cat 1, but only 6614 orders with Cat 1.
B            1572
B+A            2964
A            2078
ammartahir1978Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.