Hi Carolina,
Good that you got it working.
Be aware that there is a limit to the nesting of functions; 7 levels is the maximum.
Have a look at the VLOOKUP() function.
There's a tutorial here:
http://www.contextures.com/xlFunctions02.html
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
=IF(G23=AE$3,(AA23*AF$3),IF(G23=AE$4,(AA23*AF$4),IF(G23=AE$5,(AA23*AF$5),IF(G23=AE$6,(AA23*AF$6),IF(G23=AE$7,(AA23*AF$7),IF(G23=AE$8,(AA23*AF$8)))))))