Re: Sumproduct troubleshooting (new to me)
- From: Matt S <MattS@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Aug 2008 08:27:09 -0700
Dave,
Thanks for your help! I played around with it and finally got it to work!
I'd actually like to keep the function in the work***, so I removed the
..value portion. Here's what I came up with below. Seems the difference
between what I did and what you did was that I did not put the .value portion
on the range("AF" & i). Not exactly sure why that would be the deciding
factor.
Thanks again!
Matt
'Make Lambda and Temp Distribution Plots
Dim LambdaRange As Range
Dim TempRange As Range
Sheets("Runlog").Select
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
'Define distribution table ranges
Ldist = 0.005
TDist = 1
NumLRows = (2 - 0.5) / Ldist
NumTRows = (1500 - 20) / TDist
'Initial lambda and temp values
Range("AF8").Value = 0.8
Range("AH8").Value = 20
'Define Ranges within runlog
Set LambdaRange = Range(Cells(8, "P"), Cells(LastRow, "P"))
Set TempRange = Range(Cells(8, "N"), Cells(LastRow, "N"))
'create temp and lambda table and count # of instances data fell between
ranges
'Resource for understanding SUMPRODUCT use is here:
'http://xldynamic.com/source/xld.SUMPRODUCT.html#examples
For i = 9 To NumLRows
Range("AF" & i).Value = Range("AF" & i - 1).Value + Ldist
Range("AG" & i).Formula = "=SUMPRODUCT((" & LambdaRange.Address & ">=
" & Range("AF" & i - 1) & ") * (" & LambdaRange.Address & "<=" & Range("AF" &
i) & "))"
Next
For i = 9 To NumTRows
Range("AH" & i).Value = Range("AH" & i - 1).Value + TDist
Range("AI" & i).Formula = "=SUMPRODUCT((" & TempRange.Address & ">= "
& Range("AH" & i - 1) & ") * (" & TempRange.Address & "<=" & Range("AH" & i)
& "))"
Next
Not sure what was dif
.
- Follow-Ups:
- Re: Sumproduct troubleshooting (new to me)
- From: Dave Peterson
- Re: Sumproduct troubleshooting (new to me)
- References:
- Sumproduct troubleshooting (new to me)
- From: Matt S
- Re: Sumproduct troubleshooting (new to me)
- From: Dave Peterson
- Sumproduct troubleshooting (new to me)
- Prev by Date: Re: Can't figure out formula error
- Next by Date: RE: REPOST: Need help with XL2007 FormatConditions, please?
- Previous by thread: Re: Sumproduct troubleshooting (new to me)
- Next by thread: Re: Sumproduct troubleshooting (new to me)
- Index(es):
Loading