I am trying to find a way to calculate a value using parameters stored in different sheets/tables. I have been trying to do this with sum and vlookup without success. The input data looks like this:

Type | Power |

A | 5 |

A | 9 |

B | 0 |

B | 1 |

C | 6 |

C | 2 |

C | 3 |

D | 7 |

D | 0 |

D | 0 |

<tbody>

</tbody>

and

Type | Base |

A | 3 |

B | 3 |

C | 4 |

D | 5 |

<tbody>

</tbody>

For each line in the first table I would like to calculate

=IF(Power>0;VLOOKUP(Table1!Type;Table2;2;FALSE)*2^Table1!Power;0)

I am able to calculate this for each line, but I need to calculate the sum of this value for all the lines in a single cell.

All my attempts with VLOOKUP have so far met with failure. Any help is greatly appreciated!!

Thanks in advance!