Davidprince
Programmer
Ladies and Gentlemen
I have a table of 10,000 numbers. I am trying to work out a formula that will look up a table based on the result in the list of numbers. Initially I am looking at the last five results, wanting three occurences but may want to test for 6 or 7 numbers (with three occurences). The example should explain a little clearer:
Numbers
27
29
8
11
29
11
Based on the lookup table for 11, we find that the numbers are 11,3,8,26,29. As you can see from the table, at the first occurence of 11, there are three occurences being 11,8 and 29. That would then start a formula to look for the next occurence of one of those five numbers.
I initially tackled the problem with a vlookup picking the 11 and checking against the lookup table to see if numbers from the lookup table matched, recording that result and then summing the hits into another cell. That worked, but there were a few errors.
So there are two questions, firstly is the lookup formula the best approach and secondly can the list numbers be selected dynamically (ie: 27,29,8,11,29; 29,8,11,29,11 etc) so that each group of five is looked at? I think I am doing the latter of these, but it seemed incorrect.
Thanks
David
I have a table of 10,000 numbers. I am trying to work out a formula that will look up a table based on the result in the list of numbers. Initially I am looking at the last five results, wanting three occurences but may want to test for 6 or 7 numbers (with three occurences). The example should explain a little clearer:
Numbers
27
29
8
11
29
11
Based on the lookup table for 11, we find that the numbers are 11,3,8,26,29. As you can see from the table, at the first occurence of 11, there are three occurences being 11,8 and 29. That would then start a formula to look for the next occurence of one of those five numbers.
I initially tackled the problem with a vlookup picking the 11 and checking against the lookup table to see if numbers from the lookup table matched, recording that result and then summing the hits into another cell. That worked, but there were a few errors.
So there are two questions, firstly is the lookup formula the best approach and secondly can the list numbers be selected dynamically (ie: 27,29,8,11,29; 29,8,11,29,11 etc) so that each group of five is looked at? I think I am doing the latter of these, but it seemed incorrect.
Thanks
David