Hi snb

Originally Posted by
snb
……
in cell L1:
PHP Code:
="170.110.000." & choose(search(left($F1,1),"FHSV"),"415015","415025","415030","143015")&".0000.0000.000.000"
Thanks for that alternative.

Originally Posted by
snb
Or you might do some analysing/thinking first:
…….
That “analysing/thinking first” still would not have helped me here, as I do not have the Knowledge and experience of those Choose and Search Functions.
Thanks for giving the benefit of your extra knowledge and experience. 
Alan
_...........................................
P.s. I think I get what is going on.......
Using Excel 2007
Row\Col |
F |
G |
H |
I |
J |
K |
L |
1 |
Salik Charges |
|
|
|
3 |
415030 |
170.110.000.415030.0000.0000.000.000 |
2 |
Vehicle Fine |
|
|
|
4 |
143015 |
170.110.000.143015.0000.0000.000.000 |
3 |
Hire Charges |
|
|
|
2 |
415025 |
170.110.000.415025.0000.0000.000.000 |
4 |
Fuel Charges |
|
|
|
1 |
415015 |
170.110.000.415015.0000.0000.000.000 |
_....................
Row\Col |
F |
G |
H |
I |
J |
K |
L |
1 |
Salik Charges |
|
|
|
=SEARCH(LEFT($F1,1),"FHSV") |
=CHOOSE(J1,"415015","415025","415030","143015") |
="170.110.000." & CHOOSE(SEARCH(LEFT($F1,1),"FHSV"),"415015","415025","415030","143015")&".0000.0000.000.000" |
_............................
Code:
Option Explicit
Sub snbFormula() ' http://www.excelfox.com/forum/f2/multiple-ifs-formula-help-2089/#post9699
Let Range("L1").Value = "=" & """170.110.000."" & choose(search(left($F1,1),""FHSV""),""415015"",""415025"",""415030"",""143015"")&"".0000.0000.000.000"""
' ="170.110.000." & choose(search(left($F1,1),"FHSV"),"415015","415025","415030","143015")&".0000.0000.000.000"
' ="170.110.000." & WAHL(SUCHEN(LINKS($F1;1);"FHSV");"415015";"415025";"415030";"143015")&".0000.0000.000.000"
End Sub
' Explanation Maybe:
' = search(left($F1,1),"FHSV") ---- Searching for first letter in FHSV and returning position along
' =SUCHEN(LINKS($F1;1);"FHSV")
'
' = choose(2,"415015","415025","415030","143015") ---- as example, choose at positon 2 - so here return "415025"
' =WAHL(J1;"415015";"415025";"415030";"143015")
'
Bookmarks