Return value based on fraction of a list - VBA
On Jan 6, 5:46*pm, "Rick Rothstein"
wrote:
I still don't get it... I do not see any pattern connections between the
values in Columns P and U and a value of 1 in Q4.
Sorry folks, it was all clear in MY head!! :[
Let's forget about the "1" in Q4, and just go with numbers greater
than that.
Col U can have any number of values (typically 10 - 100).
Q4 is the divisor as JLGWhiz decided. This value (eg 8) is the amount
of approximately equal parts I need to divide Col U into [=< Average
(U:U) ].
Column P is divided in the same way, showing "1" for the first part,
"2" for the second part, etc (if Q4 is "2" then half Col P will be "1"
and the other half "2", ... if Q4 is 8 then 1/8 Col P will be "1",
the next 1/8 "2",and so on)
In my original example Q4 is "4", so:
U2:U7 is the first quarter of the total list [ie 1/4 so I need a "1"
in P2:P7],
U8:U10 is the second quarter [ie 2/4 - 1/4 so I need a "2" in
P8:P10],
U11 is the third quarter all by itself [ie 3/4 - 2/4 so I need a "3"
in P11 - sorry but I mistakenly put a "2" in my example],
U12:Ux is the fourth quarter [ie 4/4 - 3/4 so I need a "4" in P12:Ux]
Hope this helps. I'd really value a solution!
Phil
|