Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
T T is offline
external usenet poster
 
Posts: 41
Default sumproduct/evaluate

Hello.. I've tried using both of the following & neither work. Can anyone
help? The first doesn't do anything and the second returns a Value error.

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = "=SUMPRODUCT(--(a1:A" & lstRow & "),--(H1:H "
& lstRow & "< 0.0215277777777778),H1: & lstrow)"

Else 'nothing

End If

Next i

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = evaluate("SUMPRODUCT(--(a1:A" & lstRow &
"),--(H1:H " & lstRow & "< 0.0215277777777778),H1: & lstrow)")

Else 'nothing

End If

Next i
--
Thanks in advance!
T
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sumproduct/evaluate

You had an extra space in at the first '--(H1:H ' and were missing an H in
the last ',H1:' and had the ending parenthesis handled wrongly also. I think
this is probably what you want...

Cells(1, 1).Formula = "=SUMPRODUCT(--(a1:A" & lstrow & "),--(H1:H" & _
lstrow & "<0.0215277777777778),H1:H" & lstrow & ")"

I used the line continuation character to control the break point... you can
remove it and rejoin the two lines if you want to have the statement all on
one line.

Rick


"T" wrote in message
...
Hello.. I've tried using both of the following & neither work. Can anyone
help? The first doesn't do anything and the second returns a Value error.

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = "=SUMPRODUCT(--(a1:A" & lstRow & "),--(H1:H "
& lstRow & "< 0.0215277777777778),H1: & lstrow)"

Else 'nothing

End If

Next i

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = evaluate("SUMPRODUCT(--(a1:A" & lstRow &
"),--(H1:H " & lstRow & "< 0.0215277777777778),H1: & lstrow)")

Else 'nothing

End If

Next i
--
Thanks in advance!
T


  #3   Report Post  
Posted to microsoft.public.excel.programming
T T is offline
external usenet poster
 
Posts: 41
Default sumproduct/evaluate

Thanks Rick,

Don't know how I missed that! I do have one more problem now ... In the
first part of the formula, "=SUMPRODUCT(--(a1:A" & lstrow & " I want the
equivalent of "=SUMPRODUCT(--(a1:a" & lstrow & "=" & cells (i,1).value. In
other words (a1:a16 = a1).
The syntax I tried doesn't work.

One other question if I could... when do you need to use "evaluate"?. Only
if you need to commit the formula in Excel with control+shift+enter?

Thanks again!

--
T


"Rick Rothstein (MVP - VB)" wrote:

You had an extra space in at the first '--(H1:H ' and were missing an H in
the last ',H1:' and had the ending parenthesis handled wrongly also. I think
this is probably what you want...

Cells(1, 1).Formula = "=SUMPRODUCT(--(a1:A" & lstrow & "),--(H1:H" & _
lstrow & "<0.0215277777777778),H1:H" & lstrow & ")"

I used the line continuation character to control the break point... you can
remove it and rejoin the two lines if you want to have the statement all on
one line.

Rick


"T" wrote in message
...
Hello.. I've tried using both of the following & neither work. Can anyone
help? The first doesn't do anything and the second returns a Value error.

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = "=SUMPRODUCT(--(a1:A" & lstRow & "),--(H1:H "
& lstRow & "< 0.0215277777777778),H1: & lstrow)"

Else 'nothing

End If

Next i

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = evaluate("SUMPRODUCT(--(a1:A" & lstRow &
"),--(H1:H " & lstRow & "< 0.0215277777777778),H1: & lstrow)")

Else 'nothing

End If

Next i
--
Thanks in advance!
T



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sumproduct/evaluate

Is this what you are looking for?

Cells(i + 1, 9).Formula = "=SUMPRODUCT(--(A1:A" & lstRow & "=A" & i & _
"),--(H1:H" & lstRow & "<0.0215277777777778),H1:H" & lstRow & ")"

As for Evaluate... well, it evaluates an expression and produces a result...
a value (text or number) or an object (range, for one). An example (from the
Help files) would be...

trigVariable = Evaluate("SIN(45)")

which assigns 0.850903524534118 to the variable. This kind of output is not
something you would assign to the Formula property of a range.

Rick


"T" wrote in message
...
Thanks Rick,

Don't know how I missed that! I do have one more problem now ... In the
first part of the formula, "=SUMPRODUCT(--(a1:A" & lstrow & " I want the
equivalent of "=SUMPRODUCT(--(a1:a" & lstrow & "=" & cells (i,1).value.
In
other words (a1:a16 = a1).
The syntax I tried doesn't work.

One other question if I could... when do you need to use "evaluate"?.
Only
if you need to commit the formula in Excel with control+shift+enter?

Thanks again!

--
T


"Rick Rothstein (MVP - VB)" wrote:

You had an extra space in at the first '--(H1:H ' and were missing an H
in
the last ',H1:' and had the ending parenthesis handled wrongly also. I
think
this is probably what you want...

Cells(1, 1).Formula = "=SUMPRODUCT(--(a1:A" & lstrow & "),--(H1:H" & _
lstrow & "<0.0215277777777778),H1:H" & lstrow & ")"

I used the line continuation character to control the break point... you
can
remove it and rejoin the two lines if you want to have the statement all
on
one line.

Rick


"T" wrote in message
...
Hello.. I've tried using both of the following & neither work. Can
anyone
help? The first doesn't do anything and the second returns a Value
error.

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = "=SUMPRODUCT(--(a1:A" & lstRow &
"),--(H1:H "
& lstRow & "< 0.0215277777777778),H1: & lstrow)"

Else 'nothing

End If

Next i

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = evaluate("SUMPRODUCT(--(a1:A" & lstRow &
"),--(H1:H " & lstRow & "< 0.0215277777777778),H1: & lstrow)")

Else 'nothing

End If

Next i
--
Thanks in advance!
T




  #5   Report Post  
Posted to microsoft.public.excel.programming
T T is offline
external usenet poster
 
Posts: 41
Default sumproduct/evaluate

That's it. Thanks so much for your assistance, Rick!


--
T


"Rick Rothstein (MVP - VB)" wrote:

Is this what you are looking for?

Cells(i + 1, 9).Formula = "=SUMPRODUCT(--(A1:A" & lstRow & "=A" & i & _
"),--(H1:H" & lstRow & "<0.0215277777777778),H1:H" & lstRow & ")"

As for Evaluate... well, it evaluates an expression and produces a result...
a value (text or number) or an object (range, for one). An example (from the
Help files) would be...

trigVariable = Evaluate("SIN(45)")

which assigns 0.850903524534118 to the variable. This kind of output is not
something you would assign to the Formula property of a range.

Rick


"T" wrote in message
...
Thanks Rick,

Don't know how I missed that! I do have one more problem now ... In the
first part of the formula, "=SUMPRODUCT(--(a1:A" & lstrow & " I want the
equivalent of "=SUMPRODUCT(--(a1:a" & lstrow & "=" & cells (i,1).value.
In
other words (a1:a16 = a1).
The syntax I tried doesn't work.

One other question if I could... when do you need to use "evaluate"?.
Only
if you need to commit the formula in Excel with control+shift+enter?

Thanks again!

--
T


"Rick Rothstein (MVP - VB)" wrote:

You had an extra space in at the first '--(H1:H ' and were missing an H
in
the last ',H1:' and had the ending parenthesis handled wrongly also. I
think
this is probably what you want...

Cells(1, 1).Formula = "=SUMPRODUCT(--(a1:A" & lstrow & "),--(H1:H" & _
lstrow & "<0.0215277777777778),H1:H" & lstrow & ")"

I used the line continuation character to control the break point... you
can
remove it and rejoin the two lines if you want to have the statement all
on
one line.

Rick


"T" wrote in message
...
Hello.. I've tried using both of the following & neither work. Can
anyone
help? The first doesn't do anything and the second returns a Value
error.

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = "=SUMPRODUCT(--(a1:A" & lstRow &
"),--(H1:H "
& lstRow & "< 0.0215277777777778),H1: & lstrow)"

Else 'nothing

End If

Next i

For i = 1 To lstRow - 1
If Cells(i, 1).Value < Cells(i + 1, 1).Value Then
Cells(i + 1, 9).Formula = evaluate("SUMPRODUCT(--(a1:A" & lstRow &
"),--(H1:H " & lstRow & "< 0.0215277777777778),H1: & lstrow)")

Else 'nothing

End If

Next i
--
Thanks in advance!
T




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Blank cells using evaluate(=sumproduct) Gwen Excel Programming 3 November 29th 06 12:08 AM
EVALUATE SUMPRODUCT formula Robert Excel Programming 3 April 25th 06 08:28 AM
Why won't Sumproduct funciton evaluate this data [email protected] Excel Worksheet Functions 1 March 8th 06 07:56 PM
Evaluate sumproduct question ram Excel Programming 12 December 23rd 05 11:04 PM
Evaluate - Sumproduct GRRR Paul M. Excel Programming 2 July 25th 03 04:17 AM


All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"