I dentifying the furthest digit back

D

dkenebre

I would like to create a VBA or formula that allows me to go back to
specific rows or number of records in the database to locate and list
how many records since the last time the farthest back value of the 3
evaluated cell values last occurred.

example:
,,,,,,,,,,,,C41
9,,,,6,,,,2

,,,,,,,,,,,,C47
0,,,,7,,,3
A49
7,,,,4,,,,1
A51 B51 C51 (The evaluated cells)
3,,,,7,,,,2

Therefore, the result would list 7, because from the cell values
3,7,2, #2 was the farthest back, when we manually selected the last 10
odd row records and the last 2 previous even row records of cells A,
B and C to review. This is a total of 12 records of A, B and C cell
values being evaluated by this condition. Number 2 last occurred 7
records ago, which were within the 2 previous A,B, C cell records and
last 5 odd A,B, C cell row records back.
Another way to explain it is:
F28 G28 H28 (The evaluated cells)
6 5 2

The last occurrence of number 6 was 2 days ago at G26, it is the
earliest most recent days back occurrence of the numbers within F28,
G28 and H28, then number 5 appears the next most recently back in cell
H24, then number 2 is the furthest days back since it’s last
occurrence, it’s last occurrence was in F20, or 8 rows back Because
number 2 was furthest back, I want to list the number of rows since the
occurrence of the furthest back of the numbers 6, 5 and 2 in the P
column, in this case cell C28. Because I manually selected the last 20
consecutive rows back to evaluate this condition. Therefore, the answer
would be 8, because number 2 last occurred 8 cell rows back within the
20 selected rows of cells F, G and H and is the furthest back of the 3
cell values evaluated. The function or formula will only review the of
rows back that have been manually selected. I would like to pick the
rows to evaluate this condition.

So I would want the function or formula if possible to evaluate cells
ae, af, and ag and place the answer in cell p
 
D

dkenebre

The following sample displays the correct answers in column O for the
selected rows 16, 18, 20, 22, 24, 26 and 29 which it compares the
condition in this case to only the previous even numbered rows in the
chart which have data in the R,S,T cells.
Can anyone help with creating a VBA for this problem:


+----------------------------------------------------------------+
| Attachment filename: book1b.xls |
|Download attachment: http://www.excelforum.com/attachment.php?postid=350910|
+----------------------------------------------------------------+
 
T

Tushar Mehta

Help with what?

It doesn't hurt to quote the previous post. Remember, the site you are
using posts your request to the Usenet newsgroup, and while the site
might provide a perpetual trail of the messages, individuals using
newsgroup readers configure them to their own taste.

For more on directly accessing the newsgroups, see the 'Outlook Express
and Newsgroups' tutorial on my web site.

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top