Hi msiyab,

_ I wasted a lot of time at the start of my “Excel carrier” doing multiple Ifs. If you really do want to do it that way then you simply do nested If’s

Pseudo Code:

= If ( x , 1 , ~~~ if ( y , 2 , …………… and so on ) ~~~ )

In XL up to 2003 that will work for up to 7 If’s. For XL 2007 + that will work for 64 Ifs

This is then what you want for your example:

Using Excel 2007
Row\Col
L
1
=IF(F1="Salik Charges","170.110.000.415030.0000.0000.000.000",IF (F1="Hire Charges","170.110.000.415025.0000.0000.000.000",IF (F1="Vehicle Fine","170.110.000.143015.0000.0000.000.000",IF(F1 ="Fuel Charges","170.110.000.415015.0000.0000.000.000","" ))))
2
=IF(F2="Salik Charges","170.110.000.415030.0000.0000.000.000",IF (F2="Hire Charges","170.110.000.415025.0000.0000.000.000",IF (F2="Vehicle Fine","170.110.000.143015.0000.0000.000.000",IF(F2 ="Fuel Charges","170.110.000.415015.0000.0000.000.000","" ))))
3
=IF(F3="Salik Charges","170.110.000.415030.0000.0000.000.000",IF (F3="Hire Charges","170.110.000.415025.0000.0000.000.000",IF (F3="Vehicle Fine","170.110.000.143015.0000.0000.000.000",IF(F3 ="Fuel Charges","170.110.000.415015.0000.0000.000.000","" ))))
4
=IF(F4="Salik Charges","170.110.000.415030.0000.0000.000.000",IF (F4="Hire Charges","170.110.000.415025.0000.0000.000.000",IF (F4="Vehicle Fine","170.110.000.143015.0000.0000.000.000",IF(F4 ="Fuel Charges","170.110.000.415015.0000.0000.000.000","" ))))

_.....................
Here are the results

Row\Col
F
G
H
I
J
K
L
1
Salik Charges 170.110.000.415030.0000.0000.000.000
2
Vehicle Fine 170.110.000.143015.0000.0000.000.000
3
Hire Charges 170.110.000.415025.0000.0000.000.000
4
Fuel Charges 170.110.000.415015.0000.0000.000.000

_.......................

Of course you only need to put the formula in L1 in and then drag down

But: I learnt the hard way it was well worth learning how to use VLookUp, which is much more flexible and neater..

I will show that in the next post ( as those long formulas use up most of the Post space!!!.. )