View Single Post
  #4   Report Post  
Biff
 
Posts: n/a
Default

Sorry, can't help with a macro. But look how easy it is using worksheet
functions!

Biff

"Robert" wrote in message
...
This doesn't make any snese. How do I put this formula in a macro.
Please
explain. Thankks.
--
RSF


"Biff" wrote:

Hi!

Column A = decimal values
Column B = integer values

D1 = 1
E1 = 1.3

=SUMPRODUCT(--(A1:A5=D1),--(A1:A5<=E1),B1:B5)

Biff

"Robert" wrote in message
...
I am trying todo something which I "thought" would be simple.

I have a column of number from 0 through 77. I have another column
beside
of it. The numbers are like this:

1 5
1.1 6
1.3 4
1.35 5
1.5 6

All the way to 77.

I am trying to write a code in VBA that says, basically, if the value
in
this cell is between (for instance, 1 and 1.3 then sum the values from
the
corresponding column. The answer to the above would be 15. ELSE, if
the
values are between 1.35 and 1.5, then sum the values in the
corresponding
column (the answer being 11) and so on. I wanted to store the answer
values
in specified cells on the same worksheet. Can someone please help?
Thanks.
--
RSF