Formula to add values based on the date range.

please see attached.

how can i sum based on the given date range.
EE.xlsx
LVL 6
FloraAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
You are mixing date formats in the date range column, can that be corrected to always use the same format?  Otherwise the formula won't know how to interpret something like 01/06/2017, it will have no way of knowing if this is in MM/DD/YYYY format, or DD/MM/YYYY format.


»bp
Rob HensonFinance AnalystCommented:
You can use a Pivot Table for that, grouping the dates into Quarters.
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
It seems you want to summarize the amount quarter wise. You can use the pivot table to achieve that.
Pls refer to the attached.
EE.xlsx
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Rgonzo1971Commented:
Hi,

pls try
=SUMIFS(B:B,A:A,">="&DATEVALUE(LEFT(E2,8)),A:A,"<="&DATEVALUE(RIGHT(E2,8)))

Open in new window

Regards

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
FloraAuthor Commented:
thanks. i do not want pivot tables.
i prefer sumproduct formula that i can add more condition to them.
Bill PrewIT / Software Engineering ConsultantCommented:
If you do adjust the dates then you can try:

=SUMIFS($B:$B,$A:$A,">="&TRIM(LEFT($E2,FIND("-",$E2)-1)),A:A,"<="&TRIM(MID($E2,FIND("-",$E2)+1,999)))

Open in new window


»bp
Rob HensonFinance AnalystCommented:
For a purely formula driven approach, as Bill mentions, you have to ensure that the dates are of a consistent format.

When that is corrected then the SUMIFS suggestion by RGonzo can be used for multiple conditions; currently being used with only two conditions to create the range between dates.
Rgonzo1971Commented:
as a sumproduct
=SUMPRODUCT(B:B,--(A:A>=DATEVALUE(LEFT(E2,8))),--(A:A<=DATEVALUE(RIGHT(E2,8))))

Open in new window

FloraAuthor Commented:
thanks Rgonzo. it worked for me
FloraAuthor Commented:
thank you very much everyone. much appreciated.
FloraAuthor Commented:
Bill, thank you. your formula also works.
FloraAuthor Commented:
this formula from Rgonzo is super =
SUMPRODUCT(B:B,--(A:A>=DATEVALUE(LEFT(E2,8))),--(A:A<=DATEVALUE(RIGHT(E2,8))))

Open in new window

FloraAuthor Commented:
i posted a follow up question.
FloraAuthor Commented:
Rgonzo1971

i get value if the dates are not quarter based.

Date Ranges
01/01/18- 03/23/18
01/01/19- 03/23/19


i posted a new question.
Rob HensonFinance AnalystCommented:
Based on the format of the other dates, those dates are not valid dates. All the other dates are in "dd/mm/yy" format but the end dates for these two are not as there is not a 23rd month of the year.

If your local settings are set to recognise "dd/mm/yy" then DATEVALUE on a text string like you have with those two entries will throw an error.
FloraAuthor Commented:
thanks Robert.  it is now working. i made a mistake. my dates are always dd mm yy and Rgonzo's formula works just fine.

thanks again for your professional help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.