I have a method for you, but I find it hard to believe there isn't a more
efficient set of formulas than what I have come up with. (Translation...
check back into this thread from time to time to see if anyone has posted
something better.<g>)
Click the header for the column containing your High Values in order to
select this entire column. Next, click Format/Conditional Formatting from
Excel's menu bar. Change the first drop-down field to "Formula Is" and then
copy/paste this formula into the second field...
=AND(ROW(A1)>=SUMPRODUCT(MAX(ROW($A$1:$A$1000)*($A$1:$A$1000<>"")))-10,A1=MAX(INDIRECT(ADDRESS(SUMPRODUCT(MAX(ROW($A$1:$A$1000)*($A$1:$A$1000<>"")))-10,1)&":"&ADDRESS(SUMPRODUCT(MAX(ROW($A$1:$A$1000)*($A$1:$A$1000<>""))),1))))
Then click the Format button and select the format you want for the 10-day
high. Click OK to get back to the Conditional Formatting dialog box and
click the Add button there. For Condition 2 (what appeared when you clicked
the Add button), change its first drop-down field to "Formula Is" and then
copy/paste this formula into its second field...
=AND(ROW(A1)>=SUMPRODUCT(MAX(ROW($A$1:$A$1000)*($A$1:$A$1000<>"")))-20,A1=MAX(INDIRECT(ADDRESS(SUMPRODUCT(MAX(ROW($A$1:$A$1000)*($A$1:$A$1000<>"")))-20,1)&":"&ADDRESS(SUMPRODUCT(MAX(ROW($A$1:$A$1000)*($A$1:$A$1000<>""))),1))))
Note: The above two formulas are designed for Column A; if you need to use
them in another column, change all the A's to that column's letter(s)
designation **and** change both appearances of ",1" (no quote marks are in
the formulas themselves, I just used them to group the two characters) to a
comma followed by the column's numerical index.
Now, click the Format button and select the format you want for the 20-day
high.Then click OK to get back to the Conditional Formatting dialog box and,
finally, click its OK button to activate the conditional format you just
selected. Your 10-day high will have the format you selected for it and your
20-day high will have whatever format you chose for it. If the 10-day high
is higher than any values in the 11th through 20th day, then only format
(the 10-day one) will be displayed (we could probably add a third
conditional format for this if you absolute need it).
Now, you would do exactly the same procedure for the 10-day and 20-day lows,
but use these formulas where indicated...
Condition 1:
=AND(ROW(B1)>=SUMPRODUCT(MAX(ROW($B$1:$B$1000)*($B$1:$B$1000<>"")))-10,B1=MIN(INDIRECT(ADDRESS(SUMPRODUCT(MAX(ROW($B$1:$B$1000)*($B$1:$B$1000<>"")))-10,2)&":"&ADDRESS(SUMPRODUCT(MAX(ROW($B$1:$B$1000)*($B$1:$B$1000<>""))),2))))
Condition 2:
=AND(ROW(B1)>=SUMPRODUCT(MAX(ROW($B$1:$B$1000)*($B$1:$B$1000<>"")))-20,B1=MIN(INDIRECT(ADDRESS(SUMPRODUCT(MAX(ROW($B$1:$B$1000)*($B$1:$B$1000<>"")))-20,2)&":"&ADDRESS(SUMPRODUCT(MAX(ROW($B$1:$B$1000)*($B$1:$B$1000<>""))),2))))
Note: The above two formulas are designed for Column B; if you need to use
them in another column, change all the B's to that column's letter(s)
designation **and** change both appearances of ",2" (no quote marks are in
the formulas themselves, I just used them to group the two characters) to a
comma followed by the column's numerical index.
Rick