Solved

Excel SUMIF for specific dates.

Posted on 2013-12-13
11
623 Views
Last Modified: 2013-12-13
I have 2 columns of data. Dates and currency.
I need a formula that will look for a specific month and year  in the date range and then sum up corresponding currency values.

The issue i have is that the date is not plain text, it comes from another formula. The same goes for currency on one of my sheets. I have a few sheets for apply this to.

If I replace the date as actual date text I can make this work with SUMIF but when the date comes from another formula my end result is always $0.00

How to do I specify a range of dates and have it pass the date values instead of the formula that generated those dates?
I attached an example of what I want it to look like.
I'd like each formula to reference the year 2014 in the corner and the month JAN.... above.
The purpose of my report is to go through a list of all the support contracts we have and add up the ammounts for each month of the year.

Thanks
excel-dates.png
0
Comment
Question by:baysysadmin
  • 6
  • 4
11 Comments
 
LVL 11

Accepted Solution

by:
Angelp1ay earned 500 total points
Comment Utility
Check attachment :)

=SUMIFS($I$12:$I$15,$B$12:$B$15,">="&B2,$B$12:$B$15,"<="&EOMONTH(B2,0))

Open in new window

SumIfsWithDates.xlsx
0
 

Author Comment

by:baysysadmin
Comment Utility
Great start but your formula has the same issue as mine.
It only works if the date is text. But mine comes form another formula which looks like this..

=IF($B12="",".",INDEX(Network!$P$2:$P$1000,MATCH(CONCATENATE("*",$B12,"*"),Network!$A$2:$A$1000,0)))

and returns a value of

20-Jan-14

 So how do we pass that value as date text?
0
 
LVL 4

Expert Comment

by:LCCSAM
Comment Utility
Maybe record a macro to copy the formula results into a separate list of values then work from there? (or is that infeasible?)
0
 

Author Comment

by:baysysadmin
Comment Utility
This sheet will be used by few people, im trying to keep it as simple as possible with as few extra columns as possible.

I already have a separate summary list of these date which is made by the big formula above.
Id hate to make another list from my list.

Is there no way to change how it passes that date value?
0
 

Author Comment

by:baysysadmin
Comment Utility
Im not sure why but I got it working.
I changed the date range to a Named range and now number values add up.
I guess it doesnt like $I$12:$I$15 way of doing it.

ill do some more testing before closing the question.


Thanks for your help.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 11

Expert Comment

by:Angelp1ay
Comment Utility
All of my cells are dates. Sorry should have pointed out even the month headers are now dates (with custom formatting).
0
 

Author Comment

by:baysysadmin
Comment Utility
Yes i saw that and it worked for me with named ranges.


I am not having another issue.
We use Atlassian confluence, and after I embedd the excel all my numbers show as $0.00
I think confluence excel plug in cant render SUMIFS formulas.
Ive had this issue with other formulas and conditional formating.

Is there a different way of doing this, using some more legacy formulas?
0
 
LVL 11

Expert Comment

by:Angelp1ay
Comment Utility
You could add a column to your second table that gives the first of that month.
=EOMONTH(B20,-1)+1

Open in new window


Then you could use SUMIF instead of SUMIFS (because you just match with equal instead of in the range).
0
 

Author Comment

by:baysysadmin
Comment Utility
didnt work, so I tried it this way and it worked and embeded fine with confluence BUT it didnt work for those dates that came from a formula only text dates, even after using named ranges.


{=SUM(IF(YEAR(SoftwareDates)=YEAR(B$2),IF(MONTH(SoftwareDates)=MONTH(B$2),SoftwarePrices,0)))}

Turns out that some of the forumals in my date range return a "."
The reason i put a . is so I can see that there is a fromula there rather than having a blank cell.
so I changed the . to a 0 and now dates evalute fine using above formula.
0
 

Author Closing Comment

by:baysysadmin
Comment Utility
Thanks
0
 
LVL 11

Expert Comment

by:Angelp1ay
Comment Utility
Glad you found a way!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now