Hi, I made a spreadsheet to track costs. Its been working fine for months but has randomly stopped woring. Its been driving me crazy for 3 days now. I can't see the issue! Please help before i lose my mind!
I have uploaded the file
Thanks,
Gareth
Hi, I made a spreadsheet to track costs. Its been working fine for months but has randomly stopped woring. Its been driving me crazy for 3 days now. I can't see the issue! Please help before i lose my mind!
I have uploaded the file
Thanks,
Gareth
Your dates, you cant say this
=SUMIFS(Purchase!$H$7:$H$631,Purchase!$G$7:$G$631,"CAPEX",Purchase!$I$7:$I$631,">=01-Apr",Purchase!$I$7:$I$631,"<=30-Apr")
01-Apr is a string but the value in Purchase! column I are dates, ie numbers.
Since 01-Apr is a string so is 01-Jan.
But you'll find 01-Jan is greater than 01-Apr yet Jan comes before Apr
You should correct ALL your formulas to this, changing the month where necessary.
=SUMIFS(Purchase!$H$7:$H$631,Purchase!$G$7:$G$631,"CAPEX",Purchase!$I$7:$I$631,">="&DATEVALUE("01/04/2017"),Purchase!$I$7:$I$631,"<=DATEVALUE("30/04/2017"))
Regards
Special-K
Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.
Your dates look dodgy to me. Try specific dates or variables that produce dates. I went with the following in D5:
=COUNTIFS(Purchase!$G$7:$G$631,"CAPEX",Purchase!$I$7:$I$631,">="&$C$2,Purchase!$I$7:$I$631,"<="&EOMONTH($C$2,0))
Better yet:
=COUNTIFS(Purchase!$G$7:$G$631,$C5,Purchase!$I$7:$I$631,">="&$C$2,Purchase!$I$7:$I$631,"<="&EOMONTH($C$2,0))
Last edited by CAntosh; 03-21-2017 at 01:13 PM. Reason: Made "type" variable so you can fill down...
In D5 and copied down that section:
=COUNTIFS(Purchase!$G$7:$G$631,$C5,Purchase!$I$7:$I$631,">="&$C$2,Purchase!$I$7:$I$631,"<="&EOMONTH($C$2,0))
Now adjust that starting formula for the top cell of each section, then copy down within the section.
The main problem is your dates in the original formulas, but this solves other small issues as well.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Hi Guys,
Thanks for that, the COUNTIFS are working great. Have adapted the formula for the SUMIFS and thats working for April but May and beyond are working but as a running total (ie adding April to Mays etc.) Im having a brain fart of a day on this, cant see teh wood for the trees
=SUMIFS(Purchase!$H$7:$H$631,Purchase!$G$7:$G$631,"CAPEX",Purchase!$I$7:$I$631,"<="&EOMONTH($G$2,0))
Thanks,
Gareth
It looks like you're missing the 'greater than' term, so it's just giving you everything prior to May 31. Try the following in I5:
=SUMIFS(Purchase!$H$7:$H$631,Purchase!$G$7:$G$631,G5,Purchase!$I$7:$I$631,">="&$G$2,Purchase!$I$7:$I$631,"<="&EOMONTH($G$2,0))
or:
=SUMIFS(Purchase!$H$7:$H$631,Purchase!$G$7:$G$631,"CAPEX",Purchase!$I$7:$I$631,">="&$G$2,Purchase!$I$7:$I$631,"<="&EOMONTH($G$2,0))
All sorted. Thanks to everyone!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks