Using "MONTH" with Defined Names Returning Results 2 Months Off

SewStage

Board Regular
Joined
Mar 16, 2021
Messages
70
Office Version
  1. 365
Platform
  1. Windows
I have the following formula used to display rolling inventory totals each month (replicated across row 2), where PPIVITEM and PPIVCOUNT are Defined Names from a pivot table (tab) used to add inventory purchases each month. As you can see from both the purchase entry and the pivot table, 5 animal eyes were added on 10/1, but it's being reflected two months earlier in August on the Material by Mo. tab; this is true for any item that has been added and any purchase date that is used. If I spell out the entire formula instead of using Defined Names it works just fine. Thoughts on why this is happening/what may be wrong in my Defined Names? Thanks much.
2021 Inventory Management.xlsx
ABCDEFGHIJKLMNO
1Item DescriptionUOM31-DecJanFebMarAprMayJunJulAugSepOctNovDec
2Animal eyes (sets)set3838383838383838434343  
Material by Mo.
Cell Formulas
RangeFormula
D2:O2D2=IF(MONTH(D1)<=MONTH(TODAY()),C2+SUMIF(PPIVITEM,$A$2,PPIVCOUNT),"")

Pivot table:
2021 Inventory Management.xlsx
ABCDEFGHIJKLMN
2JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC
3Sum of Units
4123456789101112Grand Total
5Animal eyes (sets)55
Purchases pivot table

Purchases (tab):
2021 Inventory Management.xlsx
ABCDEFGHIJKL
1CategoryDescriptionDetails Cost UnitsPer Unit CostSourceDate of PurchaseOnlinePay SourceMo of PurchaseYr of Purchase
46NotionsAnimal eyes (sets)$ 10.005$ 2.00Amazon10/1/2021X102021
Material purchases
Cell Formulas
RangeFormula
F46F46=IF(E46>0,D46/E46,"")
K46K46=MONTH((H46))

Defined Names:
1633148133012.png


Results without using Defined Names:
2021 Inventory Management.xlsx
ABCDEFGHIJKLMNO
1Item DescriptionUOM31-DecJanFebMarAprMayJunJulAugSepOctNovDec
2Animal eyes (sets)set3838383838383838383843  
Material by Mo.
Cell Formulas
RangeFormula
D2:O2D2=IF(MONTH(D1)<=MONTH(TODAY()),C2+SUMIF('Purchases pivot table'!$A$5:$A$150,'Material by Mo.'!$A$2,'Purchases pivot table'!B$5:B$150),"")
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
OK Try this.
In the materials sheet select Cell D2 (Jan),
go into the Name Manager
select PPIVCOUNT and hit edit
You should find it currently says
='Purchases Pivot Table'!C$2:C$150
Change this to (change C to B)
='Purchases Pivot Table'!B$2:B$150
Save the change.

Does that fix the issue ?
 
Upvote 0
Solution
OK Try this.
In the materials sheet select Cell D2 (Jan),
go into the Name Manager
select PPIVCOUNT and hit edit
You should find it currently says
='Purchases Pivot Table'!C$2:C$150
Change this to (change C to B)
='Purchases Pivot Table'!B$2:B$150
Save the change.

Does that fix the issue ?
I gotta say, I'm embarrassed I didn't catch that! Guess that's why a second set of eyes is always good. Thanks so much, Alex; very much appreciated!
 
Upvote 0
No problem. I don't think a misalignment in the relative addressing of a named range is actually that obvious. Happy to have been able to provide the second set of eyes. ;)
 
Upvote 0

Forum statistics

Threads
1,214,849
Messages
6,121,925
Members
449,056
Latest member
denissimo

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