Excel formula for automating calculation

Tripleseas

Board Regular
Joined
Jul 12, 2022
Messages
87
Office Version
  1. 2013
Platform
  1. Windows
Hello community,

I want to automate some work in excel that need to be done.
the data below is just a preview of a large data set that I need to work on so i can't do it manually.

is there any formula that can do the following :

i want to calculate the number for each categorie ( CASH1, CASH2, CASH3 and so on : there is alot of columns that i have ) based on :
- for each category ( formula to be put on E4, i want the formula the lookup the products name and the name of the category in the table below and extract the percentage related, then multiply the total number of operations for that product in that percenatge )

I did it with the formula below but it's manual! is there any way that i can automate this.

thanks all

test.xlsx
BCDEFG
2CASH1CASH2CASH3
3ProductsTotal operationsNumberNumberNumber
4X12,336,7849,732120,39713,150
5X21,762,05314,219
6X31,171,839
7X4971,453
8X5108,421
9X6130,000
10
11
12
13
14
15
16Products%
17CASH1X10.42%
18CASH1X20.81%
19CASH1X30.61%
20CASH1X40.96%
21CASH1X50.92%
22CASH1X60.99%
23CASH2X15.15%
24CASH2X25.94%
25CASH2X34.36%
26CASH2X47.27%
27CASH2X54.70%
28CASH2X64.93%
29CASH3X10.56%
30CASH3X20.76%
31CASH3X30.33%
32CASH3X40.78%
33CASH3X50.73%
34CASH3X60.66%
GLOBAL
Cell Formulas
RangeFormula
F4F4=D4*E23
G4G4=D4*E29
E4:E5E4=D4*E17
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
does
=INDEX($D$16:$D$33,MATCH($B3&D$1,$C$16:$C$33&$B$16:$B$33,0))*$C3
work for you ?

Book1
ABCDEF
1CASH1CASH2CASH3
2ProductsTotal operationsNumberNumberNumber
3X12336784.179,732120,39713,150
4X21762053.1814,219104,68413,409
5X31171838.997,16051,1373,911
6X4971453.1649,27870,5867,568
7X5108421.0349995,095797
8X61300001,2846,410863
9
10
11
12
13
14
15Products%
16CASH1X10.42%
17CASH1X20.81%
18CASH1X30.61%
19CASH1X40.96%
20CASH1X50.92%
21CASH1X60.99%
22CASH2X15.15%
23CASH2X25.94%
24CASH2X34.36%
25CASH2X47.27%
26CASH2X54.70%
27CASH2X64.93%
28CASH3X10.56%
29CASH3X20.76%
30CASH3X30.33%
31CASH3X40.78%
32CASH3X50.73%
33CASH3X60.66%
34
Sheet1
Cell Formulas
RangeFormula
D3:F8D3=INDEX($D$16:$D$33,MATCH($B3&D$1,$C$16:$C$33&$B$16:$B$33,0))*$C3
 
Upvote 0
does
=INDEX($D$16:$D$33,MATCH($B3&D$1,$C$16:$C$33&$B$16:$B$33,0))*$C3
work for you ?

Book1
ABCDEF
1CASH1CASH2CASH3
2ProductsTotal operationsNumberNumberNumber
3X12336784.179,732120,39713,150
4X21762053.1814,219104,68413,409
5X31171838.997,16051,1373,911
6X4971453.1649,27870,5867,568
7X5108421.0349995,095797
8X61300001,2846,410863
9
10
11
12
13
14
15Products%
16CASH1X10.42%
17CASH1X20.81%
18CASH1X30.61%
19CASH1X40.96%
20CASH1X50.92%
21CASH1X60.99%
22CASH2X15.15%
23CASH2X25.94%
24CASH2X34.36%
25CASH2X47.27%
26CASH2X54.70%
27CASH2X64.93%
28CASH3X10.56%
29CASH3X20.76%
30CASH3X30.33%
31CASH3X40.78%
32CASH3X50.73%
33CASH3X60.66%
34
Sheet1
Cell Formulas
RangeFormula
D3:F8D3=INDEX($D$16:$D$33,MATCH($B3&D$1,$C$16:$C$33&$B$16:$B$33,0))*$C3
Thank you so much i managed to get solid results with it. I have applied it as an array formula then it worked :)
will keep applying to my real data and see if everything goes smooth.

thank so much for the help.
 
Upvote 0
you are welcome, I so used now to using 365 version , i forget that older versions need the control/shift/enter to add the {} - 365 just knows its an array and works automatically -sorry about that
 
Upvote 0
Power Query solution (in case you want to play around with that).

Load the lower table as connection only. Load the upper table, then merge them (Right Outer). Expand the CASH and percentage categories. Multiply the percent and total operations columns. This yields a data table that is easily loaded into a pivot table.

(Comma is the decimal point in my Excel.)
Book2
FGHIJ
2ProductsTotal operationsCategoryPercentMultiplication
3X12336784,17CASH10,42%9731,768361
4X12336784,17CASH25,15%120397,0438
5X21762053,181CASH10,81%14219,31272
6X31171838,989CASH10,61%7159,580686
7X4971453,1639CASH10,96%9277,856614
8X5108421,0339CASH10,92%998,8441716
9X6130000CASH10,99%1284,408423
10X21762053,181CASH25,94%104684,133
11X31171838,989CASH24,36%51137,29699
12X4971453,1639CASH27,27%70585,79842
13X5108421,0339CASH24,70%5095,40515
14X6130000CASH24,93%6410,090878
15X12336784,17CASH30,56%13150,16415
16X21762053,181CASH30,76%13408,53248
17X31171838,989CASH30,33%3910,7279
18X4971453,1639CASH30,78%7567,621542
19X5108421,0339CASH30,73%796,8294315
20X6130000CASH30,66%863,4734484
Sheet11
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top