Hi
Hopefully somebody can help me as my eyes are beginning to burn I have been looking at this so long!
Basically I am exporting data from another programme in to Excel and need to perform a less than ordinary (for me) VLOOKUP to another workbook.
The aim is to look up the value of column H in workbook A, and depending on the text contained in column C return the value of different columns of workbook B.
Eg. If column C contains the text JNT, i want to return column 21, or if it contains CAB i want to return column 25.
Here are some examples of what I have tried so far:
I'm sure there will be a way of doing this, but my mind is drawing a blank! I would potentially like to put this in VBA so it can be used on multiple spreadsheets (all will have exactly the same format and look up the same values.).
Thanks in anticipation.
Andy
Hopefully somebody can help me as my eyes are beginning to burn I have been looking at this so long!
Basically I am exporting data from another programme in to Excel and need to perform a less than ordinary (for me) VLOOKUP to another workbook.
The aim is to look up the value of column H in workbook A, and depending on the text contained in column C return the value of different columns of workbook B.
Eg. If column C contains the text JNT, i want to return column 21, or if it contains CAB i want to return column 25.
Here are some examples of what I have tried so far:
- =VLOOKUP(H3,'[2010 work programme Ap.xls]Capital EAST in detail'!$A:$Z,IF(C3="JNT",21,IF(C3="FIT",22,IF(C3="OHL",23,IF(C3="RC",24,IF(C3="CAB",25,IF(C3="CIV",26,14)))))),FALSE)
- =IF(SEARCH("JNT",$C3),VLOOKUP($H3,'[2010 work programme Ap.xls]Capital EAST in detail'!$A:$Z,21,FALSE),IF(SEARCH("FIT",$C3),VLOOKUP($H3,'[2010 work programme Ap.xls]Capital EAST in detail'!$A:$Z,22,FALSE),IF(SEARCH("OHL",$C3),VLOOKUP($H3,'[2010 work programme Ap.xls]Capital EAST in detail'!$A:$Z,23,FALSE),IF(SEARCH("CAB",$C3),VLOOKUP($H3,'[2010 work programme Ap.xls]Capital EAST in detail'!$A:$Z,25,FALSE),IF(SEARCH("CIV",$C3),VLOOKUP($H3,'[2010 work programme Ap.xls]Capital EAST in detail'!$A:$Z,26,FALSE),"X")))))
- =VLOOKUP(H3,'[2010 work programme Ap.xls]Capital EAST in detail'!$A:$Z,IF(SEARCH("JNT",C3),21,IF(SEARCH("FIT",C3),22,IF(SEARCH("OHL",C3),23,IF(SEARCH("CAB",C3),25,IF(SEARCH("CIV",C3),26,14))))),FALSE)
I'm sure there will be a way of doing this, but my mind is drawing a blank! I would potentially like to put this in VBA so it can be used on multiple spreadsheets (all will have exactly the same format and look up the same values.).
Thanks in anticipation.
Andy