G
Gary Thomson
Hi,
I have a text string, which is always 10 characters long.
Each character can be either "1", or any letter from "a"
through "z".
Examples:
1111111111 (each character is a "1")
11b1c11d1e (mostly 1's, with other letters)
11b11b1bbb (a recurring letter - "b")
I want to check each character in the string in turn,
starting with the character on the left, and sum
their "lookup values" (from a table in sheet 2) as follows:
If the first character is not a "1", lookup the first
character in the table in sheet 2, otherwise 0.
PLUS
If the second character is not a "1" AND is not the same
character as the first character, then lookup the second
character in the table in sheet 2, otherwise 0.
PLUS
If the third character is not a "1" AND is not the same as
the first character AND is not the same as the second
character, then lookup the third character in sheet 2,
otherwise 0.
and so on for all 10 characters, where the 10th character
would only be "looked-up" if it was not a "1" and not the
same as any of the previous 9 characters
The formula I have so far is:
=IF(MID(H481,1,1)="1",0,VLOOKUP(MID(H481,1,1),Services!
$N$10:$S$87,6,FALSE))+IF(AND(MID(H481,2,1)<>"1",MID
(H481,2,1)<>MID(H481,1,1)),VLOOKUP(MID(H481,2,1),Services!
$N$10:$S$87,6,FALSE),0)+IF(AND(MID(H481,3,1)<>"1",MID
(H481,3,1)<>MID(H481,1,1),MID(H481,3,1)<>MID
(H481,2,1)),VLOOKUP(MID(H481,3,1),Services!
$N$10:$S$87,6,FALSE),0)..........
Which is HUGE, and I need this formula in a 31 by 500
range, which has made my spreadshett 50MB.
Is there a simpler way to do this??
I have a text string, which is always 10 characters long.
Each character can be either "1", or any letter from "a"
through "z".
Examples:
1111111111 (each character is a "1")
11b1c11d1e (mostly 1's, with other letters)
11b11b1bbb (a recurring letter - "b")
I want to check each character in the string in turn,
starting with the character on the left, and sum
their "lookup values" (from a table in sheet 2) as follows:
If the first character is not a "1", lookup the first
character in the table in sheet 2, otherwise 0.
PLUS
If the second character is not a "1" AND is not the same
character as the first character, then lookup the second
character in the table in sheet 2, otherwise 0.
PLUS
If the third character is not a "1" AND is not the same as
the first character AND is not the same as the second
character, then lookup the third character in sheet 2,
otherwise 0.
and so on for all 10 characters, where the 10th character
would only be "looked-up" if it was not a "1" and not the
same as any of the previous 9 characters
The formula I have so far is:
=IF(MID(H481,1,1)="1",0,VLOOKUP(MID(H481,1,1),Services!
$N$10:$S$87,6,FALSE))+IF(AND(MID(H481,2,1)<>"1",MID
(H481,2,1)<>MID(H481,1,1)),VLOOKUP(MID(H481,2,1),Services!
$N$10:$S$87,6,FALSE),0)+IF(AND(MID(H481,3,1)<>"1",MID
(H481,3,1)<>MID(H481,1,1),MID(H481,3,1)<>MID
(H481,2,1)),VLOOKUP(MID(H481,3,1),Services!
$N$10:$S$87,6,FALSE),0)..........
Which is HUGE, and I need this formula in a 31 by 500
range, which has made my spreadshett 50MB.
Is there a simpler way to do this??