I've been working on this for a while and cannot get it to work.
In the attached example, I have cells E5-E35 in which the user can input various codes. The codes consist of one letter and one number (from 1-8), with the letter always appearing first. There can be one or two codes entered per cell. For example, a cell can have "V4" or "V4 P2"
In E37, I would like to add up the total values for all "V" codes (which can range from V1 to V8). Unfortunately, the "V" code can be the first or second code entered, as this will depend on the users. Thus, the "V" can either be the 1st value or the 4th value (counting the blank between the codes as a value) in the cell.
I tried the following, but keep getting the #VALUE! error.
=SUM(IF(LEFT(E$5:E$35,2)="V1",1),IF(LEFT(E$5:E$35,2)="V2",2),IF(LEFT(E$5:E$35,2)="V3",3),IF(LEFT(E$5:E$35,2)="V4",4),IF(LEFT(E$5:E$35,2)="V5",5),IF(LEFT(E$5:E$35,2)="V6",6),IF(LEFT(E$5:E$35,2)="V7",7),(IF(LEFT(E$5:E$35,2)="V8",8))+SUM(IF(MID(E$5:E$35,4,2)="V1",1),IF(MID(E$5:E$35,4,2)="V2",2),IF(MID(E$5:E$35,4,2)="V3",3),IF(MID(E$5:E$35,4,2)="V4",4),IF(MID(E$5:E$35,4,2)="V5",5),IF(MID(E$5:E$35,4,2)="V6",6),IF(MID(E$5:E$35,4,2)="V7",7),IF(MID(E$5:E$35,4,2)="V8",8)))
Thanks in advance for your help.
Bookmarks