CountIfs with OR lookup from a table

vegasbaby207

Board Regular
Joined
Nov 13, 2008
Messages
53
Hi,

I have a working CountIfs formula which is referencing a table (CurrentSeason) to facilitate multiple OR criteria:

{=SUM(COUNTIFS(tblItemsAU[Season],CurrentSeason[Prefix],tblItemsAU[QuantityOnHand],0))}

The formula counts the number of items in a table where QuantityOnHand is zero, and the product belongs to one of our current season range. It works as desired.

In an adjacent cell, I have another similar formula which does the same thing for Previous season ranges:

{=SUM(COUNTIFS(tblItemsAU[Season],PreviousSeason[Prefix],tblItemsAU[QuantityOnHand],0))}

As you can see, the formula is using a different table to build the OR criteria.

To make the solution a little more elegant (and scalable), I'd like to consolidate the two tables (CurrentSeason and PreviousSeason) into a single table, with a new column indicating if the product is Current or Previous season. This is easily done obviously. However, I am unsure if I can amend the above formulas so that the array can be restricted by another column.

Hope this makes sense.

Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi V

yes, add another pair of range,criteria for the current/previous column.
ie.
{=SUM(COUNTIFS(tblItemsAU[Season],CurrentSeason[Prefix],tblItemsAU[QuantityOnHand],0,tblItemsAU[CurrentPrevious],"Current"))}
{=SUM(COUNTIFS(tblItemsAU[Season],CurrentSeason[Prefix],tblItemsAU[QuantityOnHand],0,tblItemsAU[CurrentPrevious],"Previous"))}
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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