Filtering an array based on month.

FrancisM

Board Regular
Joined
Apr 12, 2016
Messages
139
I have 3 different areas of a worksheet allowing data entry or doing calculations.

The first area is cell rang C7:F7. C7 is a date entry field, D7 is a size entry field. I.e. 6m,6W,…… E7 is a quantity entry field. F7 is populated with this formula; =SUM(COUNTIFS(D7,{"6M","6W","6.5M","6.5W","7M","7W","7.5M","7.5W","8M","8W","8.5M","8.5W","9M","9W","9.5M","9.5W","10M","10W","10.5M","11M","11.5M","12M","13M","14M"}))*E7 If the entry in D7 matches any of the sizes above it calculates number of that size based on E7.

The second area is Range i7:j7. I7 is populated with this formula =IF(C7="",0,MONTH(C7)), & is based on cell C7 (date entry). J7 IS populated with =COUNTIF(D7,"6M")*F7. It calculates the quantity of a size.

The third area is cell AJ7, &t is populated with an array. =SUM(COUNTIFS(J7,{"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29",
"30","31","32","33","34","35","36","37","38","39","40"}))*J7


If any of the numbers match J7 (size quantity) it calculates the quantity.

At present it doesn’t filter for month. I am trying to include a month filter in the array. So if the month in cell I7 is 10, the array returns the appropriate quantity. If month in cell I7 is not 10, the array returns 0. I have tried various filters, but I have gotten various error messages. What is the best way to filter the array by month?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
In I7, rather than the condition C7="" use ISBLANK(C7). C7 is a number, because dates are numbers, so it will never be a string, even a null string.
 
Upvote 0
Something strange happened. The formula worked as expected in column Aj7, however when I copied the formula to the next column Ak. the same vales were also copied. Did I do something wrong?
 
Upvote 0
I spoke too soon, however I did find out that the problem is, no month filter. A filter needs to be added to this formula =SUM(COUNTIFS(J7,{"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29",
"30","31","32","33","34","35","36","37","38","39","40"}))*E7
.
If another month is selected, it still records the amount in Nov (10).
Does anyone have suggestions? :confused:
 
Upvote 0
It appears that I am required to use helper cells. Is there workaround to that? the other question, is placement of the filter in the above array.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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