Hey,
Im new here and Im looking to sum the minimum between two columns over a large number of rows. For instance Column A would have the values 7, [ ], 9 and Column B would have the values 5, 8 , 10 and Column C would be displaying 7 / 5, 8, 9 / 10....at the bottom of Column C would be a total summing 5+8+9=22....any help would be greatly appreciated. Thanks in advance
Last edited by shwayze24; 02-03-2011 at 10:56 AM.
if you're saying you want to do this without use of C1:Cn (individual Mins) then:
adjust reference to A1:B6 as necessaryB7: =SUMPRODUCT(SUBTOTAL(5,OFFSET($A$1:$B$1,ROW($A$1:$B$6)-ROW($A$1),0)))
If you want to use Column C just add the MIN tests and SUM.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Thank you very much. Would it be possible for you to help explain the logic of what that function is doing to help my understanding?
The OFFSET takes a 1x2 range (A1:B1) and offsets from that range by 0 to n-1 rows where n is determined by last row in range (6)
In essence this means you end up with 6 different ranges
A1:B1 offset by {0;1;2;3;4;5}
A1:B1;A2:B2;A3:B3;A4:B4;A5:B5;A6:B6
to each of these ranges we apply the SUBTOTAL function specify function_num as 5 (MIN)
We use SUMPRODUCT to aggregate the 6 MINs
Word of warning - this is inefficient & Volatile (OFFSET) - it would be far more efficient to store each MIN separately (C) and SUM results.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Thank you very much, this is very helpful. I did not believe I could Min seperately C and Sum results because C is a formula :
To display A1 / B1=IF(IF(A1="",B1,IF(B1="",A1,IF(AND(A1="",B1=""),"","$"&A1&" / "&"$"&B1&" ")))=0,"",IF(O6="",P6,IF(A1="",B1,IF(B1="",A1,IF(AND(A1="",B1=""),"","$"&A1&" / "&"$"&B1&" "))))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks