SlideShare a Scribd company logo
1 of 38
XP
Introduction to MS Excel
XP
Contents
1. Identify excel components
2. Descriptions of Excel
components
3. Excel’s arithmetic operators
4. Know the order of precedence
5. Cell Referencing
6. Work with the Insert Function
button
7. Math and Statistical functions
8. Define functions, and functions
within functions
9. Examine the Insert Function
dialog box
10.Create column and pie charts in
Excel
11. Create a chart using the Chart
Wizard
12. Use of If
13. Count Function
14. Function Auditing
15. Sorting
16. Shortcut Keys
17. Add data and record a basic
script
18. create
XP
1. Identify Excel components
3
XP
2. Descriptions of Excel components
4
XP
3. Excel’s arithmetic operators
Arithmetic operations, symbols and description of their use.
5
XP
4. Know the order of precedence
The order of precedence rules must be considered when creating
expressionsmomo. The chart below illustrates Excel’s order of
precedence and shows sample expressions and the result of each
expression.
6
XP
5. Cell Referencing
7
XP
5. Cell Referencing
8
XP
5. Cell Referencing
9
XP
6. Work with the Insert Function
button
• Excel supplies more than 350 functions organized
into 10 categories:
– Database, Date and Time, Engineering, Financial,
Information, Logical, Lookup, Math, Text and Data,
and Statistical functions
• You can use the Insert Function button on the
Formula bar to select from a list of functions.
• A series of dialog boxes will assist you in filling in
the arguments of the function and this process also
enforces the use of proper syntax.
10
XP
7. Math and Statistical functions
This chart shows some commonly used math and
statistical functions and a description of what they do.
11
XP
8. Define functions, and
functions within functions
• The SUM function is a very commonly used math function
in Excel.
• A basic formula example to add up a small number of cells
is =A1+A2+A3+A4, but that method would be
cumbersome if there were 100 cells to add up.
• Use Excel's SUM function to total the values in a range of
cells like this: SUM(A1:A100).
• You can also use functions within functions. Consider the
expression =ROUND(AVERAGE(A1:A100),1).
– This expression would first compute the average of all the values
from cell A1 through A100 and then round that result to 1 digit to
the right of the decimal point
12
XP
9. Examine the Insert Function
dialog box
This dialog box appears when you click the Insert Function
button. It can assist you in defining your function.
13
XP
10. Create column and pie
charts in Excel
• Charts, or graphs, provide visual representations of the
workbook data.
• A chart may be embedded in an existing worksheet, or can
be created on a separate chart sheet, with its own tab in the
workbook.
• You can use Excel’s Chart Wizard to quickly and easily
create charts.
• The Chart Wizard is a series of dialog boxes that prompt
you for information about the chart you want to generate
14
XP
11. Create a chart using
the Chart Wizard
• To create a chart with the Chart Wizard:
– Select the data you want to chart, which will be your data source
– Click the Chart Wizard button on the standard toolbar
– In the first step of the chart wizard, select the chart type and sub-
type
– In the second step of the Chart Wizard, make any additions or
modifications to the chart's data source
– In the third step, make any modifications to the chart's appearance
– In the fourth and final step, specify the location for the chart, then
click the OK button
15
XP
11 Contd. Chart Wizard dialog box 1
Choose a chart type and view examples of that type in dialog box 1.
Choose which type of chart
you want in this pane.
Select a sub-type of
that chart in this pane.
Click and hold this
button down to see a
preview of your chart.
16
XP
11 Contd. Choosing a data series
• You can alter the data source during step 2 of the Chart
Wizard and also choose whether to organize the data
source by rows or by columns.
• The data source is organized into a collection of data
series.
– A data series consists of data values, which are plotted on the
chart's vertical, or Y-axis
– The data series’ category values, or X values, are on the horizontal
axis, called the X-axis
• A chart can have several data series all plotted against a
common set of category values.
17
XP
11. Contd. Chart Wizard dialog box 2
During the second step of the
Chart Wizard, you specify
the data to be displayed
in the chart, which is also
known as the chart's data
source.
Specify the cell range and
whether the data series is in
rows or columns.
18
XP
11. Contd. Chart Wizard dialog box 2
During the second step of the
Chart Wizard, you specify
the data to be displayed
in the chart, which is also
known as the chart's data
source.
Specify the cell range and
whether the data series is in
rows or columns.
19
XP
11. Contd. Chart Wizard dialog box 2
During the second step of the
Chart Wizard, you specify
the data to be displayed
in the chart, which is also
known as the chart's data
source.
Specify the cell range and
whether the data series is in
rows or columns.
20
XP
11. Contd. Chart Wizard dialog box 2
During the second step of the
Chart Wizard, you specify
the data to be displayed
in the chart, which is also
known as the chart's data
source.
Specify the cell range and
whether the data series is in
rows or columns.
21
XP
• To allow for three or more outcomes
• One IF function is placed inside another IF
function to test an additional condition
• More than one IF function can be nested
12. Creating Nested IFs
22
XP
12 Contd. Creating Nested IFs
23
XP
Summarizing Data Conditionally
• Use COUNTIF, SUMIF, and AVERAGEIF
functions to calculate a conditional count, sum, or
average using only cells that meet a particular
condition
12 Contd. Use of Different If
Function
24
XP
Using the COUNTIF Function
• Calculates the number of cells in a range that match
specified criteria
• Sometimes referred to as a conditional count
• Syntax:
12 Contd. Use of Different If
Function
25
XP
Using the SUMIF Function
• Adds values in a range that meet your criteria
• Also called a conditional sum
• Syntax:
12 Contd. Use of Different If
Function
26
XP
12 Contd. Use of Different If
Function
27
XP
13 Count Function
28
XP
14. Function Auditing
29
XP
15. Sorting
30
XP
16. Shortcut keys
31
XP
17. Add data and record a basic script
• Create a new Excel workbook.
• Copy the following fruit sales data and paste it into the worksheet,
starting at cell A1.
• Open the Automate tab. If you don't see the Automate tab, check the
ribbon overflow by selecting the drop-down arrow.
• Select the Record Actions button.
• Select cells A2:C2 (the "Oranges" row) and set the fill color to orange.
• Stop the recording by selecting the Stop button. 32
XP
18. Contd. Edit an existing script
The previous script colored the "Oranges" row to be orange. Let's add a yellow
row for the "Lemons".
1. From the now-open Details pane, select the Edit button.
2. You should see something similar to this code:
This code gets the current worksheet from the workbook. Then, it sets
the fill color of the range A2:C2.
33
XP
18. Contd. Edit an existing script
3. Add the following line to the end of the script (between where the color is
set and the closing }):
selectedSheet.getRange("A3:C3").getFormat().getFill().setColor("yellow
");
4. Test the script by selecting Run. Your workbook should now look like this:
34
XP
18. Contd. Create a Table
Let's convert this fruit sales data into a table. We'll use our
script for the entire process.
1. Add the following line to the end of the script (before the
closing }):
let table = selectedSheet.addTable("A1:C5", true);
1. That call returns a Table object. Let's use that table to sort the
data. We'll sort the data in ascending order based on the values in
the "Fruit" column. Add the following line after the table
creation:
table.getSort().apply([{ key: 0, ascending: true }]); 35
XP
18. Contd. Create a Table
Your script should look like this:
function main(workbook: ExcelScript.Workbook) {
// Set fill color to FFC000 for range Sheet1!A2:C2
let selectedSheet = workbook.getActiveWorksheet();
selectedSheet.getRange("A2:C2").getFormat().getFill().setColor("FFC000");
selectedSheet.getRange("A3:C3").getFormat().getFill().setColor("yellow");
let table = selectedSheet.addTable("A1:C5", true);
table.getSort().apply([{ key: 0, ascending: true }]);
}
3. Run the script. You should see a table like this:
36
XP
18. Contd. Re-run the script
1. Create a new worksheet in the current workbook.
2. Copy the fruit data from the beginning of the tutorial and paste
it into the new worksheet, starting at cell A1.
3. Run the script.
37
XP
18. References
• https://www.slideshare.net/love1200/ms-excel-
ppt-presentation
• https://www.youtube.com/watch?v=PfOo2MjiSX
0
• https://www.youtube.com/watch?v=-
ujVQzTtxSg&list=PLWPirh4EWFpEpO6NjjWLb
KSCb-wx3hMql
• https://learn.microsoft.com/en-
us/office/dev/scripts/tutorials/excel-tutorial
38

More Related Content

Similar to MS_Excel_Module4.1 ffor beginners yo .pptx

Excel2002
Excel2002Excel2002
Excel2002
pprinik
 
Excel formulas-manual
Excel formulas-manualExcel formulas-manual
Excel formulas-manual
srv1972
 
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wiMAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
AbramMartino96
 
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wiMAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
AbramMartino96
 
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docxENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
YASHU40
 
Advanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptxAdvanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptx
CliffordBorromeo
 
In Section 1 on the Data page, complete each column of the spreads.docx
In Section 1 on the Data page, complete each column of the spreads.docxIn Section 1 on the Data page, complete each column of the spreads.docx
In Section 1 on the Data page, complete each column of the spreads.docx
sleeperharwell
 

Similar to MS_Excel_Module4.1 ffor beginners yo .pptx (20)

Excel2002
Excel2002Excel2002
Excel2002
 
Excel formulas-manual
Excel formulas-manualExcel formulas-manual
Excel formulas-manual
 
Excel for research
Excel  for researchExcel  for research
Excel for research
 
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wiMAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
 
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wiMAT 240 Random Sampling in Excel Tutorial This tutorial wi
MAT 240 Random Sampling in Excel Tutorial This tutorial wi
 
MS Excel and Visual Basic Applications.pptx
MS Excel and Visual Basic Applications.pptxMS Excel and Visual Basic Applications.pptx
MS Excel and Visual Basic Applications.pptx
 
Tech training workshop 3 final 090810
Tech training   workshop 3 final 090810Tech training   workshop 3 final 090810
Tech training workshop 3 final 090810
 
Basic Ms excel
Basic Ms excelBasic Ms excel
Basic Ms excel
 
Microsoft Excel Tutorial
Microsoft Excel TutorialMicrosoft Excel Tutorial
Microsoft Excel Tutorial
 
Pranavi verma-class-9-spreadsheet
Pranavi verma-class-9-spreadsheetPranavi verma-class-9-spreadsheet
Pranavi verma-class-9-spreadsheet
 
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docxENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
ENGR 102B Microsoft Excel Proficiency LevelsPlease have your in.docx
 
Advanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptxAdvanced Spreadsheet Skills-1.pptx
Advanced Spreadsheet Skills-1.pptx
 
Itm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers keyItm310 problem solving #7 complete solutions correct answers key
Itm310 problem solving #7 complete solutions correct answers key
 
Useful Excel Functions & Formula Used everywhere.pptx
Useful Excel Functions & Formula Used everywhere.pptxUseful Excel Functions & Formula Used everywhere.pptx
Useful Excel Functions & Formula Used everywhere.pptx
 
Microsoft Excel.pptx
Microsoft Excel.pptxMicrosoft Excel.pptx
Microsoft Excel.pptx
 
In Section 1 on the Data page, complete each column of the spreads.docx
In Section 1 on the Data page, complete each column of the spreads.docxIn Section 1 on the Data page, complete each column of the spreads.docx
In Section 1 on the Data page, complete each column of the spreads.docx
 
50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks 50 MS Excel Tips and Tricks
50 MS Excel Tips and Tricks
 
How to create graphs for science
How to create graphs for scienceHow to create graphs for science
How to create graphs for science
 
Libre Office Calc Lesson 4: Understanding Functions
Libre Office Calc Lesson 4: Understanding FunctionsLibre Office Calc Lesson 4: Understanding Functions
Libre Office Calc Lesson 4: Understanding Functions
 
9 - Advanced Functions in MS Excel.pptx
9 - Advanced Functions in MS Excel.pptx9 - Advanced Functions in MS Excel.pptx
9 - Advanced Functions in MS Excel.pptx
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 

MS_Excel_Module4.1 ffor beginners yo .pptx

  • 2. XP Contents 1. Identify excel components 2. Descriptions of Excel components 3. Excel’s arithmetic operators 4. Know the order of precedence 5. Cell Referencing 6. Work with the Insert Function button 7. Math and Statistical functions 8. Define functions, and functions within functions 9. Examine the Insert Function dialog box 10.Create column and pie charts in Excel 11. Create a chart using the Chart Wizard 12. Use of If 13. Count Function 14. Function Auditing 15. Sorting 16. Shortcut Keys 17. Add data and record a basic script 18. create
  • 3. XP 1. Identify Excel components 3
  • 4. XP 2. Descriptions of Excel components 4
  • 5. XP 3. Excel’s arithmetic operators Arithmetic operations, symbols and description of their use. 5
  • 6. XP 4. Know the order of precedence The order of precedence rules must be considered when creating expressionsmomo. The chart below illustrates Excel’s order of precedence and shows sample expressions and the result of each expression. 6
  • 10. XP 6. Work with the Insert Function button • Excel supplies more than 350 functions organized into 10 categories: – Database, Date and Time, Engineering, Financial, Information, Logical, Lookup, Math, Text and Data, and Statistical functions • You can use the Insert Function button on the Formula bar to select from a list of functions. • A series of dialog boxes will assist you in filling in the arguments of the function and this process also enforces the use of proper syntax. 10
  • 11. XP 7. Math and Statistical functions This chart shows some commonly used math and statistical functions and a description of what they do. 11
  • 12. XP 8. Define functions, and functions within functions • The SUM function is a very commonly used math function in Excel. • A basic formula example to add up a small number of cells is =A1+A2+A3+A4, but that method would be cumbersome if there were 100 cells to add up. • Use Excel's SUM function to total the values in a range of cells like this: SUM(A1:A100). • You can also use functions within functions. Consider the expression =ROUND(AVERAGE(A1:A100),1). – This expression would first compute the average of all the values from cell A1 through A100 and then round that result to 1 digit to the right of the decimal point 12
  • 13. XP 9. Examine the Insert Function dialog box This dialog box appears when you click the Insert Function button. It can assist you in defining your function. 13
  • 14. XP 10. Create column and pie charts in Excel • Charts, or graphs, provide visual representations of the workbook data. • A chart may be embedded in an existing worksheet, or can be created on a separate chart sheet, with its own tab in the workbook. • You can use Excel’s Chart Wizard to quickly and easily create charts. • The Chart Wizard is a series of dialog boxes that prompt you for information about the chart you want to generate 14
  • 15. XP 11. Create a chart using the Chart Wizard • To create a chart with the Chart Wizard: – Select the data you want to chart, which will be your data source – Click the Chart Wizard button on the standard toolbar – In the first step of the chart wizard, select the chart type and sub- type – In the second step of the Chart Wizard, make any additions or modifications to the chart's data source – In the third step, make any modifications to the chart's appearance – In the fourth and final step, specify the location for the chart, then click the OK button 15
  • 16. XP 11 Contd. Chart Wizard dialog box 1 Choose a chart type and view examples of that type in dialog box 1. Choose which type of chart you want in this pane. Select a sub-type of that chart in this pane. Click and hold this button down to see a preview of your chart. 16
  • 17. XP 11 Contd. Choosing a data series • You can alter the data source during step 2 of the Chart Wizard and also choose whether to organize the data source by rows or by columns. • The data source is organized into a collection of data series. – A data series consists of data values, which are plotted on the chart's vertical, or Y-axis – The data series’ category values, or X values, are on the horizontal axis, called the X-axis • A chart can have several data series all plotted against a common set of category values. 17
  • 18. XP 11. Contd. Chart Wizard dialog box 2 During the second step of the Chart Wizard, you specify the data to be displayed in the chart, which is also known as the chart's data source. Specify the cell range and whether the data series is in rows or columns. 18
  • 19. XP 11. Contd. Chart Wizard dialog box 2 During the second step of the Chart Wizard, you specify the data to be displayed in the chart, which is also known as the chart's data source. Specify the cell range and whether the data series is in rows or columns. 19
  • 20. XP 11. Contd. Chart Wizard dialog box 2 During the second step of the Chart Wizard, you specify the data to be displayed in the chart, which is also known as the chart's data source. Specify the cell range and whether the data series is in rows or columns. 20
  • 21. XP 11. Contd. Chart Wizard dialog box 2 During the second step of the Chart Wizard, you specify the data to be displayed in the chart, which is also known as the chart's data source. Specify the cell range and whether the data series is in rows or columns. 21
  • 22. XP • To allow for three or more outcomes • One IF function is placed inside another IF function to test an additional condition • More than one IF function can be nested 12. Creating Nested IFs 22
  • 23. XP 12 Contd. Creating Nested IFs 23
  • 24. XP Summarizing Data Conditionally • Use COUNTIF, SUMIF, and AVERAGEIF functions to calculate a conditional count, sum, or average using only cells that meet a particular condition 12 Contd. Use of Different If Function 24
  • 25. XP Using the COUNTIF Function • Calculates the number of cells in a range that match specified criteria • Sometimes referred to as a conditional count • Syntax: 12 Contd. Use of Different If Function 25
  • 26. XP Using the SUMIF Function • Adds values in a range that meet your criteria • Also called a conditional sum • Syntax: 12 Contd. Use of Different If Function 26
  • 27. XP 12 Contd. Use of Different If Function 27
  • 32. XP 17. Add data and record a basic script • Create a new Excel workbook. • Copy the following fruit sales data and paste it into the worksheet, starting at cell A1. • Open the Automate tab. If you don't see the Automate tab, check the ribbon overflow by selecting the drop-down arrow. • Select the Record Actions button. • Select cells A2:C2 (the "Oranges" row) and set the fill color to orange. • Stop the recording by selecting the Stop button. 32
  • 33. XP 18. Contd. Edit an existing script The previous script colored the "Oranges" row to be orange. Let's add a yellow row for the "Lemons". 1. From the now-open Details pane, select the Edit button. 2. You should see something similar to this code: This code gets the current worksheet from the workbook. Then, it sets the fill color of the range A2:C2. 33
  • 34. XP 18. Contd. Edit an existing script 3. Add the following line to the end of the script (between where the color is set and the closing }): selectedSheet.getRange("A3:C3").getFormat().getFill().setColor("yellow "); 4. Test the script by selecting Run. Your workbook should now look like this: 34
  • 35. XP 18. Contd. Create a Table Let's convert this fruit sales data into a table. We'll use our script for the entire process. 1. Add the following line to the end of the script (before the closing }): let table = selectedSheet.addTable("A1:C5", true); 1. That call returns a Table object. Let's use that table to sort the data. We'll sort the data in ascending order based on the values in the "Fruit" column. Add the following line after the table creation: table.getSort().apply([{ key: 0, ascending: true }]); 35
  • 36. XP 18. Contd. Create a Table Your script should look like this: function main(workbook: ExcelScript.Workbook) { // Set fill color to FFC000 for range Sheet1!A2:C2 let selectedSheet = workbook.getActiveWorksheet(); selectedSheet.getRange("A2:C2").getFormat().getFill().setColor("FFC000"); selectedSheet.getRange("A3:C3").getFormat().getFill().setColor("yellow"); let table = selectedSheet.addTable("A1:C5", true); table.getSort().apply([{ key: 0, ascending: true }]); } 3. Run the script. You should see a table like this: 36
  • 37. XP 18. Contd. Re-run the script 1. Create a new worksheet in the current workbook. 2. Copy the fruit data from the beginning of the tutorial and paste it into the new worksheet, starting at cell A1. 3. Run the script. 37
  • 38. XP 18. References • https://www.slideshare.net/love1200/ms-excel- ppt-presentation • https://www.youtube.com/watch?v=PfOo2MjiSX 0 • https://www.youtube.com/watch?v=- ujVQzTtxSg&list=PLWPirh4EWFpEpO6NjjWLb KSCb-wx3hMql • https://learn.microsoft.com/en- us/office/dev/scripts/tutorials/excel-tutorial 38