You are on page 1of 10

What you learn Excel Tables, Formulas & Pivot Tables

Link Topic Covered What you Learn

Formulas Using Excel Formulas in How to use "usual" Excel formulas in Excel reports
VBA
Tables Excel Tables - Use the Right The various syntax you need to work with Excel tables for
Syntax example:
● How to reference the data range
● How to add new rows or columns
● How to reference a specific row or column

PivotTables Pivot Tables - What you ● Creating a PivotTable


Need to Know ● How to format a PivotTable
● How to refresh all or a specific PivotTable
● How to change the source data of a PivotTable
● How to change an existing Pivot Cache to another Pivot
Cache
Activity Adjust all Formulas by Create a VBA routine to adjust existing formulas by adding the
Adding IFERROR at Once IFERROR function to the formulas
Using Excel Formulas in VBA
The macro adds a special formula to column F.
It's easiest is to record formulas with the macro recorder. This ensures they are always recorded with the English Library which
For sales documents starting with 8, quantity has been overstated by 50 . Column F should show the corrected Quantity only f
We'd also like to highlight the row from A to E if the revised quantity is <= 100.
Sales Customer
Company ID Document code Article code Quantity

AT1030 84030 8050 120 130


AT1030 84030 8050 104 530
AT1030 84030 8050 105 130
AT1030 84030 8050 107 740
AT1030 84031 8040 104 920
AT1030 84031 8040 107 810
AT1030 84031 8040 110 550
AT1030 88112 8040 110 530
AT1030 88112 8040 119 690
AT1030 88112 8040 120 150
AT1030 88112 8040 116 810
AT1030 88112 8040 111 640
1030SE6 88112 8040 110 570
1030SE6 88112 8040 109 260
1030SE6 85442 8050 107 270
1030SE6 85442 8050 103 670
1030SE6 85442 8050 104 470
1030SE6 85442 8050 120 530
1030SE6 85442 8050 119 360
1030SE6 85442 8050 115 840
1030SE6 85442 8050 108 830
1030SE6 88588 8040 120 500
1030SE6 88588 8040 119 890
1030NL40 88588 8040 110 180
1030NL40 88588 8040 111 780
1030NL40 88588 8040 109 590
1030NL40 88588 8040 105 130
1030NL40 88588 8040 103 110
1030NL40 88544 8040 107 800
1030NL40 88544 8040 120 300
1030NL40 88666 8030 119 330
1030NL40 88666 8030 107 490
1030NL40 88666 8030 105 500
1030AT 88666 8030 115 390
1030AT 88666 8030 116 260
1040DE 44030 8060 108 60
1040DE 44030 8060 109 60
1040DE 44032 8060 108 60
1040DE 44032 8060 109 70
1040DE 44031 8050 108 60
1040DE 44031 8050 109 50
1040DE 44031 8050 110 60
1040DE 48112 8060 109 60
1040DE 48112 8060 110 50
1040DE 48114 8050 109 60
1040DE 48114 8050 110 60
1040DE 48114 8050 111 80
1040DE 48116 8060 109 60
1040DE 48116 8060 110 60
1040DE 45442 8050 108 50
1040DE 45442 8050 109 60
1040DE 45444 8060 108 60
1040DE 45444 8060 109 70
1040DE 45444 8060 110 60
1040DE 45446 8050 111 80
1040DE 45446 8050 108 50
1040DE 44015 8060 108 60
1040DE 44015 8060 109 70
1040DE 44017 8060 108 70
1040DE 44017 8060 109 70
1040DE 44016 8050 108 70
1040DE 44016 8050 109 60
1040DE 44016 8050 110 50
1040DE 48097 8060 109 60
1040DE 48097 8060 110 70
1040DE 48099 8050 109 60
1040DE 48099 8050 110 60
1040DE 48099 8050 111 60
1040DE 48101 8060 109 60
1040DE 48101 8060 110 50
1040DE 45427 8050 108 70
1040DE 45427 8050 109 60
1040DE 45429 8060 108 80
1040DE 45429 8060 109 80
1040DE 45429 8060 110 50
1040DE 45431 8050 111 60
1040DE 45431 8050 108 60
ed with the English Library which is the default for all VBA applications.
ow the corrected Quantity only for these sales documents.
Excel Tables - Use the Right Syntax

Company ID Sales Customer Article Quantity


Document code code
AT1030 84030 8050 120 130
AT1030 84030 8050 104 530
AT1030 84030 8050 105 130
AT1030 84030 8050 107 740
AT1030 84031 8040 104 920
AT1030 84031 8040 107 810
AT1030 84031 8040 110 550
AT1030 88112 8040 110 530
AT1030 88112 8040 119 690
AT1030 88112 8040 120 150
AT1030 88112 8040 116 810
AT1030 88112 8040 111 640
1030SE6 88112 8040 110 570
1030SE6 88112 8040 109 260
1030SE6 85442 8050 107 270
1030SE6 85442 8050 103 670
1030SE6 85442 8050 104 470
1030SE6 85442 8050 120 530
1030SE6 85442 8050 119 360
1030SE6 85442 8050 115 840
1030SE6 85442 8050 108 830
1030SE6 88588 8040 120 500
1030SE6 88588 8040 119 890
1030NL40 88588 8040 110 180
1030NL40 88588 8040 111 780
1030NL40 88588 8040 109 590
1030NL40 88588 8040 105 130
1030NL40 88588 8040 103 110
1030NL40 88544 8040 107 800
1030NL40 88544 8040 120 300
1030NL40 88666 8030 119 330
1030NL40 88666 8030 107 490
1030NL40 88666 8030 105 500
1030AT 88666 8030 115 390
1030AT 88666 8030 116 260
1040DE 44030 8060 108 60
1040DE 44030 8060 109 60
1040DE 44032 8060 108 60
1040DE 44032 8060 109 70
1040DE 44031 8050 108 60
1040DE 44031 8050 109 50
1040DE 44031 8050 110 60
1040DE 48112 8060 109 60
1040DE 48112 8060 110 50
1040DE 48114 8050 109 60
1040DE 48114 8050 110 60
1040DE 48114 8050 111 80
1040DE 48116 8060 109 60
1040DE 48116 8060 110 60
1040DE 45442 8050 108 50
1040DE 45442 8050 109 60
1040DE 45444 8060 108 60
1040DE 45444 8060 109 70
1040DE 45444 8060 110 60
1040DE 45446 8050 111 80
1040DE 45446 8050 108 50
1040DE 44015 8060 108 60
1040DE 44015 8060 109 70
1040DE 44017 8060 108 70
1040DE 44017 8060 109 70
1040DE 44016 8050 108 70
1040DE 44016 8050 109 60
1040DE 44016 8050 110 50
1040DE 48097 8060 109 60
1040DE 48097 8060 110 70
1040DE 48099 8050 109 60
1040DE 48099 8050 110 60
1040DE 48099 8050 111 60
1040DE 48101 8060 109 60
1040DE 48101 8060 110 50
1040DE 45427 8050 108 70
1040DE 45427 8050 109 60
1040DE 45429 8060 108 80
1040DE 45429 8060 109 80
1040DE 45429 8060 110 50
1040DE 45431 8050 111 60
1040DE 45431 8050 108 60
Pivot Tables - What you Need to Know
1. Record a macro that creates a PivotTable based on the CompTable and places it inside A8
2. Change the layout of the PivotTable
3. Refresh all Pivot Tables (or specific PivotTables)
4. Create a 2nd Pivot and change the Pivot Source data to reference Table inside Table2 tab
5. Change Pivot Cache of PivotTable 2 to match PivotTable1's source data
2nd Table for testing PivotTables
Company ID Sales Document Customer code Article code Quantity
AT1030 84030 8050 120 130
AT1030 84030 8050 104 530
AT1030 84030 8050 105 130
AT1030 84030 8050 107 740
AT1030 84031 8040 104 920
AT1030 84031 8040 107 810
AT1030 84031 8040 110 550
AT1030 88112 8040 110 530
AT1030 88112 8040 119 690
AT1030 88112 8040 120 150
AT1030 88112 8040 116 810
AT1030 88112 8040 111 640
1030SE6 88112 8040 110 570
1030SE6 88112 8040 109 260
1030SE6 85442 8050 107 270
1030SE6 85442 8050 103 670
Adjust all Formulas by Adding IFERROR at Once
Create a macro that locates all formulas on the worksheet and adds an IFERROR to the formula
Note that - Not all formulas are the same - formula in cell J8 is not the same as in H8.
This means that you can't just adjust H8 and copy all the way to K22. You need to make sure the existing formulas are not touc

Actual PY Budget Variance Actual to PY Variance Actual to Budge


App Revenue Profit Revenue Profit Revenue Profit Revenue% Profit% Revenue%
WenCaL 14432 240 0 0 15113 363 #DIV/0! #DIV/0! -5%
Blend 17990 1166 16395 1003 18181 1223 10% 16% -1%
Voltage 15117 1613 14138 1200 13455 1400 7% 34% 12%
Inkly 11154 731 11502 499 12031 641 -3% 46% -7%
Sleops 11022 550 14644 780 0 0 -25% -29% #DIV/0!
Kind Ape 8905 469 8796 316 9096 620 1% 48% -2%
Pet Feed 16735 800 NA NA 18207 1176 #VALUE! #VALUE! -8%
Right App 3635 96 2337 90 3579 184 56% 7% 2%
Mirrrr 15627 1996 0 0 14634 1584 #DIV/0! #DIV/0! 7%
Halotot 7270 150 7119 349 7158 120 2% -57% 2%
Flowrrr 5955 260 5612 233 5977 210 6% 12% 0%
Silvrr 7666 274 5060 369 7099 230 52% -26% 8%
Dasring 10857 281 0 0 10799 333 #DIV/0! #DIV/0! 1%
Rehire 9873 370 11069 652 NA NA -11% -43% #VALUE!
Didactic 6405 363 5995 268 0 0 7% 35% #DIV/0!

Answer is in the completed Workbook in Module "ProjectActivity"


sting formulas are not touched.

Variance Actual to Budget


Profit%
-34%
-5%
15%
14%
#DIV/0!
-24%
-32%
-48%
26%
25%
24%
19%
-16%
#VALUE!
#DIV/0!

You might also like