Dynamic range for date input

JohannesM

New Member
Joined
Jun 3, 2015
Messages
4
Hi,

I have a report were the user can choose the range by writing the "from week" in one cell and "to week" in another. The only solution I can produce is to take one sumifs for every possible week using offset, but there must be some smarter way of doing this?

This is how part of my dumb formula looks like at the moment and it only covers 3 weeks.
SUMIFS(Volume!$J:$J;Volume!$B:$B;"Out";Volume!$E:$E;H153;Volume!$G:$G;$C$140)+SUMIFS(Volume!$J:$J;Volume!$B:$B;"Out";Volume!$E:$E;H153;Volume!$G:$G;OFFSET($C$140;-1;0))+SUMIFS(Volume!$J:$J;Volume!$B:$B;"Out";Volume!$E:$E;H153;Volume!$G:$G;OFFSET($C$140;-2;0))

Is there a way to get a condition in one single sumifs that says that it should sum if the week is a part of a range as mentioned above?

Tanks in advance!
/Johannes
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,510
If column G really contains dates, then, using 2 SUMIFS together will cover any range. The logic is:
=SUMIFS(Volume!$J:$J;Volume!$B:$B;"Out";Volume!$E:$E;H153;Volume!$G:$G;">="&start_date)-SUMIFS(Volume!$J:$J;Volume!$B:$B;"Out";Volume!$E:$E;H153;Volume!$G:$G;">"&end_date)
 

JohannesM

New Member
Joined
Jun 3, 2015
Messages
4
If column G really contains dates, then, using 2 SUMIFS together will cover any range. The logic is:
=SUMIFS(Volume!$J:$J;Volume!$B:$B;"Out";Volume!$E:$E;H153;Volume!$G:$G;">="&start_date)-SUMIFS(Volume!$J:$J;Volume!$B:$B;"Out";Volume!$E:$E;H153;Volume!$G:$G;">"&end_date)

Wow, thanks that was really smart =)
Actually tried to use => but didn´t work since I didn´t know that I had to use the "".
Thanks Glenn and gaz!

Mvh
Johannes
 

Watch MrExcel Video

Forum statistics

Threads
1,122,331
Messages
5,595,549
Members
413,996
Latest member
mabelO

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
Top