Using multiple condition summing, combined with logic using date and value ranges as parameters

RedDragon

New Member
Joined
Apr 23, 2012
Messages
3
Good day, I trust someone has bumped into this kind of exercise before and would be able to assist in solving my problem.

I have the following example data set:

1
SA Rand vs US Dollar
2
3
Weighted average of the banks' daily rates at approximately 10:30 am. Weights are based on the banks' foreign exchange transactions.Variables to be compared to
4
A
B C
D
E
F
5
DateValueValueYear StartYear End
6
7
2015-01-0911.5898 R -2015-01-022015-01-09
8
2015-01-0811.6426 R -2015-01-022015-01-09
9
2015-01-0711.7248 R 11.622015-01-022015-01-09
10
2015-01-0611.7264 R 151.232015-01-022015-01-09
11
2015-01-0511.7071 R 151.232015-01-022015-01-09
12
2015-01-0211.6219 R 151.232015-01-022015-01-09
13
2014-12-3111.5719 R 151.232015-01-022015-01-09
14
2014-12-3011.622 R 151.232015-01-022015-01-09
15
2014-12-2911.6049 R 151.232015-01-022015-01-09
16
2014-12-2411.6497 R 151.232015-01-022015-01-09
17
2014-12-2311.5662
18
2014-12-2211.5905
19
2014-12-1911.6101

<tbody>
</tbody>
I need to sum Column B on the condition that the dates in column A are greater than "Year Start" cell and less than or equal to "Year End" cell value. Once this has been done, I will count the number of days in the same range between "Year Start" and "Year End" to calculate the average exchange rate for the specified date range.

The re are a few problems here that does not make sense to me currently:

1) The formula in Column E does not automatically update and point to the next row when copied down, as per normal drag-and-drop Excel functionality.

2) The greater than and equal to(>=) as well as the less than (<) logic in the function refuses to apply when using it in the SUMIFS function.

Formulas/functions used:

In the value column I have tried the following formulas to try and sum the valid range as per the logic I need to apply:

1) =SUMIFS($B$8:$B$20,$A$8:$A$20,">="&DATE(E7,E7,E7), $A$7:$A$20,"<"&DATE(F7,F7,F7)) Result = 0 Logically not correct

2) =SUMIFS($B$7:$B$20,$A$7:$A$20,"=datevalue(E8)", $A$7:$A$20,">datevalue(f8)")
Result = 0 Logically not correct

3) =SUMIF($A$7:$A$20,E9,$B$7:$B$20)
Result = R11.62, which is correct

4) =SUMIF($A$7:$A$20,"<e10",$b$7:$b$20)
Result = R151.23 which is correct5) =SUMIF($A$7:$A$20,">=E11",$B$7:$B$20)
Result = 0
Logically not correct
Please help. It will be greatly appreciated.

Andre
</e10",$b$7:$b$20)

<tbody>
</tbody>
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Shouldn't DATE(E7,E7,E7) be just E7? The DATE function's arguments are Year, Month and Day, but you already have a date in E7.
 
Upvote 0
Hi Andrew,
Thank you for the reply. If you look at the function arguments, you will see that the method used is the correct one as the function extracts the year, month,day and in other related function cases the time as well from the date-time code value. Simply using " DATE(E7)" thus does not work. One has to provide the cell reference for all three in the date function. (Excel 2013)
 
Upvote 0
My apologies Andrew. I have completely misread your comment. You are correct. My frustration still persists though and it is due to some reason Excel automatically inserts quote marks into the function. The result though from the following still produces a zero result which I fail to understand.

=SUMIFS($B$8:$B$10000,$A$8:$A$20,">=E8", $A$8:$A$20,"<F8")<f8")'
.....

<f8")
Any advice?</f8")
</f8")'
 
Last edited:
Upvote 0
One issue I see with the above formula is you don't want the E8 to be in the quotes (I assume E8 is a cell reference).
Change to:

Code:
=SUMIFS($B$8:$B$10000,$A$8:$A$20,[COLOR=#0000cd]">="&E8[/COLOR], $A$8:$A$20," .....
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,797
Members
449,337
Latest member
BBV123

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