Forum

Calculating from di...
 
Notifications
Clear all

Calculating from different tables

5 Posts
2 Users
0 Reactions
72 Views
(@brunomelki)
Posts: 46
Trusted Member
Topic starter
 

Hello.

I need to calculate a sum from different prices and data that are both kept in different tables. When I try to do so by adding field a * field b and so on, I get an automation I cannot understand and cannot correct.

I wrote in field G2 in the main sheet the calculation I need to do (without = to avoid getting a formula).

What am I doing wrong?

Thanks

 
Posted : 24/09/2020 10:30 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Bruno,

Your data in the main tab isn't in a Tabular format. You need to unpivot columns D:F, then you can merge the tables to bring in the price from the list sheet and perform the multiplication.

See file attached.

Mynda

 
Posted : 24/09/2020 6:31 pm
(@brunomelki)
Posts: 46
Trusted Member
Topic starter
 

Hi Mynda, many thanks for your quick answer.

When I worked the correct way (tabular) I didn’t find a way to fill the table easily like with a form.

The way I wrote the table, I can open a form and easily insert for each name the order by typing only the number of attributes (1 for lemon, 2 for apple etc..)

Is there another way to fill these orders while working in tabular ?

 
Posted : 25/09/2020 6:11 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Bruno,

You can keep your layout for data entry and then use Power Query to create the unpivoted layout of the data containing your calculations. A click of Refresh All on the data tab of the ribbon will update all of the queries/calculations.

If you want the data entry table to automatically calculate the price in column G, then you'd need multiple INDEX & MATCH formulas to lookup the price from the List. e.g.:

=INDEX(Prices[[Product]:[Price]],MATCH(Table2[[#Headers],[apple]],Prices[Product],0),2)*Table2[@apple]
+INDEX(Prices[[Product]:[Price]],MATCH(Table2[[#Headers],[lemon]],Prices[Product],0),2)*Table2[@lemon]
+INDEX(Prices[[Product]:[Price]],MATCH(Table2[[#Headers],[pear]],Prices[Product],0),2)*Table2[@pear]

 

Mynda

 
Posted : 25/09/2020 6:59 am
(@brunomelki)
Posts: 46
Trusted Member
Topic starter
 

Many thanks!

 
Posted : 26/09/2020 7:48 am
Share: