Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
24 views30 pages

10 It Electronic Spreadsheet Notes01-Combined

Uploaded by

sshinde8447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views30 pages

10 It Electronic Spreadsheet Notes01-Combined

Uploaded by

sshinde8447
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

myCBSEguide

CBSE Class 10 Information Technology


Revision Notes
Electronic Spreadsheet (Advanced)
Data Using Scenarios and Goal Seek

Consolidating data
Data Consolidation allows you to gather together your data from separate worksheets into a master worksheet.
In other words, the Data Consolidation function takes data from a series of worksheets or workbooks and
summaries it into a single worksheet that you can update easily.

1. Open the worksheet that contains the cell ranges to be consolidated.


2. Choose the Consolidate option under the Data menu as shown in Figure2.1. The Consolidate dialog box is
shown in Figure 2.2.

3. If the Source data range list contains named ranges, you can select a source cell range to consolidate with
other areas. If the source range is not named, click in the field to the right and either type a reference for
the first source data range or use the mouse to select the range on the sheet. (You may need to move the
Consolidate dialog to reach the required cells.)
4. Click Add. The selected range now appears on the Consolidation ranges list.
5. Select additional ranges and click Add after each selection.
6. Specify where you want to display the result by selecting a target range from the Copy results to box.
If the target range is not named, click in the field next to Copy results to and enter the reference of the
target range or select the range using the mouse or position the cursor in the top left cell of the target range.
7. Select a function from the Function list. The function specifies how the values of the consolidation ranges

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/7


myCBSEguide

are linked. The Sum function is the default setting. Most of the available functions are statistical (such as
AVERAGE, MIN, MAX, STDEV), and the tool is most useful when you are working with the same data over
and over.
8. Optionally click More in the Consolidate dialog to display additional settings.
Select Link to source data to insert the formulas. This generates the results in the target range
instead of the actual results. If you link the data, any values modified in the source range are
automatically updated in the target range. The corresponding cell references in the target range
are inserted in consecutive rows, which are automatically ordered and then hidden from view.
Only the final result, based on the selected function, is displayed.
Under Consolidate by setting, select either Row labels or Column labels, if the cells of the source
data range are not to be consolidated corresponding to the identical position of the cell in the
range, but instead according to a matching row label or column label. To consolidate by row labels
or column labels, the label must be contained in the selected source ranges. The text in the labels
must be identical, so that rows or columns can be accurately matched. If the row or column label
does not match any that exist in the target range, it will be appended as a new row or column.
9. Click OK to consolidate the ranges.
10. If you are continually working with the same range, then you probably want to use Data > Define Range to
give it a name. Define Range option is available under the Data Menu.
The data from the consolidation ranges and target range are saved when you save the worksheet. If you
later open a worksheet in which consolidation has been defined, this data will again be available.

Creating Subtotals
SUBTOTAL is a function listed under the Mathematical category when you use the Function Wizard (Insert >
Function). Because of its usefulness, the function has a graphical interface. It is accessible from Data menu as
shown in Figure 2.3.

SUBTOTAL, totals/adds data arranged in an array-that is, a group of cells with labels for columns and/or rows.
Using the Subtotals dialog, you can select arrays, and then choose a statistical function to apply to them. For
efficiency, you can choose up to three groups of arrays to which to apply a function. When you click OK, Calc
adds subtotals and grand totals to the selected arrays, using the Result and Result2 cell styles for them. Steps to
insert subtotal values into a sheet:

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/7


myCBSEguide

1. Ensure that the columns have labels.


2. Select the range of cells that you want to calculate subtotals for, and then choose Data Subtotals.
3. In the Subtotals dialog (Figure 2.4), in the Group by box, select the column that you want to add the
subtotals to. If the contents of the selected column change, the subtotals are automatically recalculated.
4. In the Calculate subtotals for box, select the columns containing the values that you 64 want to subtotal.
5. In the Use function box, select the function that you want to use to calculate the subtotals.
6. Click OK.

If you use more than one group, then you can also arrange the subtotals according to choices made on the
dialog‘s Options page (Figure 2.5), including ascending and descending order or using one of the predefined
custom sorts defined under Tools menu as Tools Options OpenOffice.org Calc Sort Lists.

Using “What If” Scenarios


Scenarios are a tool to test “what-if” questions. Each scenario is named, and can be edited and formatted
separately. When you print the spreadsheet, only the content of the currently active scenario is printed. A
scenario is essentially a saved set of cell values for your calculations. You can easily switch between these sets
using the Navigator or a drop-down list which can be shown beside the changing cells. For example, if you
wanted to calculate the effect of different interest rates on an investment, you could add a scenario for each
interest rate, and quickly view the results. Formulas that rely on the values changed by your scenario are
updated when the scenario is opened. If all your sources of income used scenarios, you could efficiently build a

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/7


myCBSEguide

complex model of your possible income.

Creating Scenarios
Use Scenarios option under Tools menu to enter variable contents-scenarios-in the same cell. To create a
scenario:

1. Select the cells that contain the values that will change between scenarios. To select multiple cells, hold
down the Ctrl key as you click each cell.
2. Choose Tools > Scenarios.
3. On the Create Scenario dialog (Figure 2.6), enter a name for the new scenario. It‘s best to use a name that
clearly identifies the scenario, not the default name as shown in the illustration. This name is displayed in
the Navigator and on the title bar of the scenario on the sheet itself.

4. Optionally add some information to the Comment box. The example shows the default comment. This
information is displayed in the Navigator when you click the Scenarios icon and select the desired scenario.
5. Optionally select or deselect the options in the Settings section. See below for more information about these
options.
6. Click OK to close the dialog. The new scenario is automatically activated. You can create several scenarios
for any given range of cells.

Using Goal Seek


Usually, you run a formula to calculate a result based upon existing values. By contrast, using Goal Seek option
under Tools menu, you can discover what values will produce the result that you want.
To take a simple example, imagine that the Chief Financial Officer of a company is developing sales projections
for each quarter of the forthcoming year. She knows what the company’s total income must be for the year to
satisfy stockholders. She also has a good idea of the company’s income in the first three quarters, because of the
contracts that are already signed. For the fourth quarter, however, no definite income is available. So how
much must the company earn in Q4 to reach its goal? The CFO can enter the projected earnings for each of the
other three quarters along with a formula that totals all four quarters. Then she runs a goal seek on the empty
cell for Q4 sales, and receives her answer.
Other uses of goal seek may be more complicated, but the method remains the same. Only one argument can be
altered in a single goal seek.

Goal Seek example

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/7


myCBSEguide

To calculate annual interest (I), create a table with the values for the capital (C), number of years (n), and
interest rate (r). The formula is I = C*n*r.
Let us assume that the interest rate r of 7.5% and the number of years n (1) will remain constant. However, you
want to know how much the investment capital C would have to be modified in order to attain a particular
return I. For this example, calculate how much capital C would be required if you want an annual return of
100,000
or it can be left blank; for number of years n, 1; for interest rate r, 7.5%). Enter the formula to calculate the
interest I in another cell. Instead of C, n, and r use the reference to the cell with the corresponding value. In our
example, this would be = B1*B2*B3.

1. Place the cursor in the formula cell (B4), and choose Tools > Goal Seek.
2. On the Goal Seek dialog, the correct cell is already entered in the Formula cell field.
3. Place the cursor in the Variable cell field. In the sheet, click in the cell that contains the value to be changed,
in this example it is B1.
4. Enter the desired result of the formula in the Target value field. In this example, the value is 15000. The
figure below shows the cells and fields.

5. Click OK. A dialog appears informing you that the Goal Seek was successful. Click Yes to enter the result in
the cell with the variable value. The result is shown below.

Using the Solver


Solver option under Tools menu amounts to a more elaborate form of Goal Seek. The difference is that the

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5/7


myCBSEguide

Solver deals with equations with multiple unknown variables. It is 68 specifically designed to minimize or
maximize the result according to a set of rules that you define.
Each of these rules sets up whether an argument in the formula should be greater than, lesser than, or equal to
the value you enter. If you want the argument to remain unchanged, you enter a rule that the cell that contains
it should be equal to its current entry. For arguments that you would like to change, you need to add two rules
to define a range of possible values: the limiting conditions. For example, you can set the constraint that one of
the variables or cells must not be bigger than another variable, or not bigger than a given value. You can also
define the constraint that one or more variables must be integers (values without decimals), or binary values
(where only 0 and 1 are allowed). Once you have finished setting up the rules, you can adjust the argument and
the results by clicking the Solve button.

Solver example
Let's say you have
1000?
To find the answer using Solver:

1. Enter labels and data: ● Row labels: Fund X, Fund Y, and total, in cells A2 thru A4.
Column labels: interest earned, amount invested, interest rate, and time period, in cells B1 thru E1.
Interest rates: 8 and 12, in cells D2 and D3.
Time period: 1, in cells E2 and E3.
Total amount invested: 10000, in cell C4.
2. Enter an arbitrary value (0 or leave blank) in cell C2 as amount invested in Fund X.
3. Enter the formulae given below:
In cell C3, enter the formula C4-C2 (total amount - amount invested in Fund X) as the amount
invested in Fund Y.
In cells B2 and B3, enter the formula for calculating the interest earned (see below).
In cell B4, enter the formula B2+B3 as the total interest earned. 69 Figure2.9: Example setup for
solver

4. Choose Tools Solver. The solver dialog opens as shown in Figure 2.10.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6/7


myCBSEguide

5. Click in the Target cell field. In the sheet, click in the cell that contains the target value. In this example it is
cell B4 containing total interest value.
6. Select Value of and enter 1000 in the field next to it. In this example, the target cell value is 1000 because
your target is a total interest earned of $1000. Select Maximum or Minimum if the target cell value needs to
be one of those extremes.
7. Click in the By changing cells field and click on cell C2 in the sheet. In this example, you need to find the
amount invested in Fund X (cell C2).
8. Enter limiting conditions for the variables by selecting the Cell reference, Operator and Value fields. In this
example, the amount invested in Fund X (cell C2) should not be greater than the total amount available (cell
C4) and should not be less than 0.
9. Click OK. A dialog appears informing you that the Solving successfully finished. Click Keep Result to enter
the result in the cell with the variable value. The result is shown below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 7/7


myCBSEguide

CBSE Class 10 Information Technology


Revision Notes
Electronic Spreadsheet (Advanced)
Data and Spreadsheets

USING MULTIPLE WORKBOOKS AND LINKING CELLS

Relevant Knowledge
Spreadsheet also allows you to link the cells from various worksheets and from various other spreadsheets to
summarize data from several sources. In this manner, you can create formulas that span different sources and
make calculations using a combination of local and linked information. Multiple sheets help keep information
organized

SETTING UP MULTIPLE SHEETS

Identifying sheets
When you open a new spreadsheet, by default, it has a sheet named Sheet1 which is managed using tabs at the
bottom of the spreadsheet, as shown below.

Inserting new sheets


There are several ways to insert a new sheet. The first step, in all cases, is to select the sheet that will be next to
the new sheet. Then do any of the following:

Select Insert > Sheet from the menu bar, or


Right-click on the tab and select Insert Sheet, or
Click in an empty space at the end of the line of sheet tabs.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/8


myCBSEguide

Each method opens the Insert Sheet dialog. Here you can choose to put the new sheet before or after the
selected sheet and how many sheets to insert.

We need 6 sheets, one for each of the 5 accounts and one as a summary sheet so we will add 3 more. We also
want to name each of these sheets for the account they represent: Summary, Checking Account, Savings
Account, Credit Card 1, Credit Card 2, and Car Loan.
We have two choices: insert 3 new sheets and rename all 6 sheets afterwards; or rename the existing sheets,
then insert the three new sheets 1 at a time, renaming each new sheet during the insert step.
To insert sheets and rename afterwards:

1. In the Insert Sheet dialog, choose the position for the new sheets (in this example, we use After current
sheet).
2. Choose New sheet and 3 as the No. of sheets. (Three sheets are already provided by default.) Because you
are inserting more than one sheet, the Name box is not available.
3. Click OK to insert the sheets.
4. For the next steps, go to "Renaming sheets" below.

To insert sheets and name them at the same time:

i. Rename the existing sheets Summary, Checking Account, and Savings Account, as described in “Renaming
sheets” below.
ii. In the Insert Sheet dialog, choose the position for the first new sheet.
iii. Choose New sheet and 1 as the No. of sheets. The Name box is now available.
iv. In the Name box, type a name for this new sheet, for example Credit Card 1.
v. Click OK to insert the sheet.
vi. Repeat steps 1-4 for each new sheet, giving them the names Credit Card 2 and Car Loan.

On the Insert Sheet dialog, you can also add a sheet from a different spreadsheet file (for example, another Calc
or Excel spreadsheet), by choosing the From file option. Click Browse and select the file; a list of the available
sheets appears in the box. Select the sheet to import. If, after you select the file, no sheets appear you probably
selected an invalid file type (not a spreadsheet, for example).
Note: For a shortcut to inserting a sheet from another file, choose Insert > Sheet from file from the menu bar.
The Insert Sheet dialog opens with the From file option preselected, and then the Insert dialog opens on top of
it.

Inserting sheets from a different spreadsheet

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/8


myCBSEguide

If you prefer, select the Link option to insert the external sheet as a link instead as a copy. This is one of several
ways to include “live” data from another spreadsheet. The links can be updated manually to show the current
contents of the external file; or, depending on the options you have selected in Tools > Options >
OpenOffice.org Calc > General > Updating, whenever the file is opened.

Renaming Worksheets
At the bottom of each worksheet window is a small tab that indicates the name of the worksheets in the
workbook. These names (Sheet1, Sheet2, Sheet3, and so on) are not very descriptive; you might want to rename
your worksheets to reflect what they contain. For instance, if your workbook contains Students Marks in
individual Subject then you may want to rename the worksheets as Subject names such as English, Mathematics
and Social Science etc.
There are three ways you can rename a worksheet, and the only difference between them is the way in which
you start the renaming process. You can do any of the following:

Double-click on one of the existing worksheet names.


Right-click on an existing worksheet name, then choose Rename from the resulting Context menu.
Select the worksheet you want to rename (click on the worksheet tab) and then select the Sheet option
from the Format menu. This displays a submenu from which you should select the Rename option.

Create Or Change A Cell Reference


A cell reference refers to a cell or a range of cells on a worksheet and can be used to find the values or data that
you want formula to calculate.
In one or several formulas, you can use a cell reference to refer to:

Data from one or more contiguous cells on the worksheet.


Data contained in different areas of a worksheet.
Data on other worksheets in the same workbook.

Referencing Other Sheets


There are two ways to reference cells in other sheets: by entering the formula directly using the keyboard or by
using the mouse. We will look at the mouse method first.

Creating The Reference With The Mouse


Look at the example below in Figure 2.14 which shows an account summary sheet with a blank Balance
column. On the Summary sheet, set up a place for all five account balances, so we know where to put the cell
reference. We want to place the reference for the checking account balance in cell B3.

To make the cell reference in cell B3, select the cell and follow these steps.

1. Click on the = icon next to the formula bar. The icons change and an equals sign appears in the formula
bars shown below.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/8


myCBSEguide

2. Now, click on the sheet tab for the sheet containing the cell to be referenced. In this case, that is the
Checking Account sheet as shown below.

3. Click on cell F3 (where the balance is) in the Checking Account sheet. The phrase ‘Checking Account’.F3
should appear in the formula bar as shown below.

4. Click the green checkmark in the formula bar to finish.


5. The Summary sheet should now look like the figure below.

Creating The Reference With The Keyboard


From the figure above, you can deduce how the cell reference is constructed. The reference has two parts: the
sheet name (’Checking Account’) and the cell reference (F3). Notice that they are separated by a period.
Note: The sheet will be in single quotes because it contains a space, and the mandatory period (.) always falls

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/8


myCBSEguide

outside any quotes. So, you can fill in the Savings Account cell reference by just typing it in. Assuming that the
balance is in the same cell in the Savings Account sheet, F3, the cell reference should be =’Savings Account’.F3.

Referencing Other Worksheets


Calc can link different files together. The process is the same as described for different sheets in a single
spreadsheet, but we add one more parameter to indicate which file the sheet is in.

Creating The Reference With The Mouse


To create the reference with the mouse, both spreadsheets need to be open. Select the cell in which the formula
is going to be entered.

1. Click the = icon next to the formula bar.


2. Switch to the other spreadsheet (the process to do this will vary depending on which operating system you
are using).
3. Select the sheet (Savings account) and then the reference cell (F3).

4. Switch back to the original spreadsheet.


5. Click on the green check mark on the formula bar.
Your spreadsheet should now resemble the figure below.

You will get a good feel for the format of the reference if you look closely at the formula bar. Based on this
line you can create the reference using the keyboard.

Creating The Reference With The Keyboard


Typing the reference is simple once you know the format the reference takes. The reference has three parts to
it:

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5/8


myCBSEguide

Path and file name


Sheet name
Cell

Looking at the figure above, you can see the general format for the reference is =’file:///Path &File
Name’#$SheetName.CellName.

Working with Hyperlinks


Hyperlinks can be used in Calc to jump to a different location from within a spreadsheet and can lead to other
parts of the current file, to different files or even to web sites.

Relative And Absolute Hyperlinks


Hyperlinks can be stored within your file as either relative or absolute.
An absolute link will stop working only if the target is moved. A relative link will stop working only if the start
and target locations change relative to each other. For instance, if you have two spreadsheets in the same folder
linked to each other and you move the entire folder to a new location, a relative hyperlink will not break.
To change the way that OOo saves the hyperlinks in your file, select Tools > Options > Load/Save > General
and choose if you want URLs saved relatively when referencing the File System, or the Internet, or both.
You can insert and modify links using the Hyperlink dialog. To display the dialog, click the Hyperlink icon

on the Standard toolbar or choose Insert > Hyperlink from the menu bar. To turn existing text into a

link, highlight it before opening the Hyperlink dialog.

On the left hand side, select one of the four types of hyperlinks:

Internet: the hyperlink points to a web address, normally starting with http://
Mail & News: the hyperlink opens an email message that is pre-addressed to a particular recipient.
Document: the hyperlink points to a place in either the current worksheet or another existing
worksheet.
New document: the hyperlink creates a new worksheet.

The top right part of the dialog changes according to the choice made for the hyperlink category from the left
panel. A full description of all the choices, and their interactions, is beyond the scope of this chapter. Here is a
summary of the most common choices used in presentations.
For an Internet hyperlink, choose the type of hyperlink (choose between Web, FTP or Telnet), and enter the
required web address (URL).
For a Mail and News hyperlink, specify whether it is a mail or news link, the receiver address and for email,

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6/8


myCBSEguide

also the subject.


For a Document hyperlink, specify the worksheet path (the Open File button opens a file browser); leave this
blank if you want to link to a target in the same spreadsheet. Optionally specify the target in the worksheet (for
example a specific sheet). Click on the Target icon to open the Navigator where you can select the target, or if
you know the name of the target, you can type it into the box.
For a New Document type hyperlink, specify whether to edit the newly created worksheet immediately (Edit
now) or just create it (Edit later) and enter the file name and the type of worksheet to create (text, spreadsheet,
etc.). The Select path button opens a directory picker dialog.
The Further settings section in the bottom right part of the dialog is common to all the hyperlink types, although
some choices are more relevant to some types of links.

Set the value of Frame to determine how the hyperlink will open. This applies to worksheets that open
in a Web browser.
Form specifies if the link is to be presented as text or as a button. The figure below shows a link
formatted as a button.

Text specifies the text that will be visible to the user. If you do not enter anything here, Calc will use
the full URL or path as the link text. Note that if the link is relative and you move the file, this text will
not change, though the target will.
Name is applicable to HTML documents. It specifies text that will be added as a NAME attribute in the
HTML code behind the hyperlink.

Linking To External Data


You can insert tables from HTML documents, and data located within named ranges from an OpenOffice.org
Calc or Microsoft Excel spreadsheet, into a Calc spreadsheet
You can do this in two ways: using the External Data dialog or using the Navigator.

Using the External Data dialog

1. Open the Calc worksheet where the external data is to be inserted. This is the target worksheet.
2. Select the cell where the upper left-hand cell of the external data is to be inserted.
3. Choose Insert -> Link to External Data.
4. On the External Data dialog, type the URL of the source worksheet or click the [...] button to open a file
selection dialog. Press Enter to get Calc to load the list of available tables.
5. In the Available tables/range list, select the named ranges or tables you want to insert. You can also specify
that the ranges or tables are updated every (number of) seconds.
6. Click OK to close this dialog and insert the linked data.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 7/8


myCBSEguide

Linking To Registered Data Sources


You can access a variety of databases and other data sources and link them into Calc worksheets. First you need
to register the data source with OpenOffice.org. (To register means to tell OOo what type of data source it is and
where the file is located.) The way to do this depends on whether or not the data source is a database in *.odb
format.
To register a data source that is in *.odb format:

1. Choose Tools Options OpenOffice.org Base Databases.


2. Click the New button (below the list of registered databases) to open the Create Database Link dialog.

3. Enter the location of the database file, or click Browse to open a file browser and select the database file.
4. Type a name to use as the registered name for the database and click OK. The database is added to the list
of registered databases. The OK button is enabled only when both fields are filled in.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 8/8


myCBSEguide

CBSE Class 10 Information Technology


Revision Notes
Electronic Spreadsheet (Advanced)
WorkSheet Data

Relevant Knowledge
In most office settings, there is a shared drive where teams can store common files for everyone to use. This
usually leads to sighting of the message: “The document [file name] is locked for editing by another user. To
open a read-only copy of this document, click“!! This message appears because someone else already has the file
open.
Sometimes however, it is necessary to have multiple people working on a file at the same time. This can be to
either speed up data entry or simply make things easier for collaboration purposes.
Spreadsheet software allows the user to share the workbook and place it in the network location where several
users can access it simultaneously. In this exercise, you will learn how to share a worksheet in OpenOffice Calc.

Setting Up A Spreadsheet For Sharing


At any time, you can set up a spreadsheet for sharing with others. With the spreadsheet document open, choose
Tools > Share Document to activate the collaboration features for this worksheet. A dialog opens where you can
choose to enable or disable sharing.
To enable sharing, select the box at the top of the dialog, and then click OK. A message appears stating that you
must save the worksheet to activate shared mode. Click Yes to continue. The word (shared) is then shown on the
title bar after the worksheet's title.
The Tools > Share Document command can be used to switch the mode for a worksheet from unshared to
shared. However, if you want to use a shared worksheet in unshared mode, you need to save the shared
worksheet using another name or path. This creates a copy of the spreadsheet that is not shared.

Opening A Shared Spreadsheet


When you open a spreadsheet that is in shared mode, you see a message that the worksheet is in shared mode
and that some features are not available in this mode. You can choose to disable this message for the future.
After clicking OK, the worksheet is opened in shared mode.
The following features are known to be disabled in a shared spreadsheet:

Edit > Changes, except for Merge Document


Edit > Compare Document
Edit > Sheet > Move/Copy & Delete
Insert > Cells Shift Cells Down & Shift Cells Right
Insert > Sheet from file
Insert > Names
Insert > Comment
Insert > Picture > From File
Insert > Movie and Sound
Insert > Object
Insert > Chart
Insert > Floating Frame
Format > Sheet > Rename, Tab Color
Format > Merge Cells > Merge and Center, Merge Cells, Split Cells
Format > Print Ranges

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/7


myCBSEguide

Tools > Protect Document


Data > Define Range
Data > Sort
Data > Subtotals
Data > Validity
Data > Multiple Operations
Data > Consolidate
Data > Group and Outline (all)
Data >DataPilot

Saving A Shared Spreadsheet


When you save a shared spreadsheet, one of several situations may occur:

If the worksheet was not modified and saved by another user since you opened it, the worksheet is
saved.
If the worksheet was modified and saved by another user since you opened it, one of the following
events will occur:
If the changes do not conflict, the worksheet is saved, the dialog below appears, and any cells modified
by the other user are shown with a red border.

If the changes conflict, the Resolve Conflicts dialog is shown. You must decide for each conflict which
version to keep, yours or the other person’s. When all conflicts are resolved, the worksheet is saved.
While you are resolving the conflicts, no other user can save the shared worksheet.

If another user is trying to save the shared worksheet and resolve conflicts, you see a message that the
shared spreadsheet file is locked due to a merge-in in progress. You can choose to cancel the Save
command for now, or retry saving later. When you successfully save a shared spreadsheet, the
worksheet shows the latest version of all changes that got saved by all users.
Note: Most spreadsheets software automatically turns off some features in shared workbooks. This is

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/7


myCBSEguide

to simplify the workbook since multiple people can be working on the file at the same time. For
example, shared workbooks don‘t allow merging cells, conditional formatting, or inserting
pictures/graphs/etc.
Perform the following activity till you are confident:
S.No. Activity

1. Share worksheet data with other users.

Record Changes
Calc has the feature to track what data was changed, when the change was made, who made the change and in
which cell the change has occurred. If you are the sponsor of a youth baseball team. The coach has submitted a
budget to you for the season and you need to edit the costs and return it to her. You are concerned that if you
just make the changes, then the coach won't see the changes you made. You decide to use Calc with the record
changes feature turned on, so that the coach can easily see the changes you have made.
The figure below shows the budget spreadsheet your coach submitted.

Looking Over The Values,


You see a few places where money could be saved:

Post-game snacks can be bought by parents.


New uniforms can wait; only buy 10 to replace damaged ones.
Buy cheaper baseballs.
Only buy 2 spare gloves.

To make these changes, use the record changes feature in Calc. To start recording changes:

1. Open the Budget Spreadsheet.


2. Select Edit > Changes > Record from the menu bar.
3. Begin editing the worksheet.

A colored border, with a dot in the upper left-hand corner, appears around a cell where changes were
made. Other reviewers then quickly know which cells were edited. A deleted column or row is marked by
a heavy colored bar.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/7


myCBSEguide

Some changes, for example cell formatting, are not recorded and marked.
To change the color that indicates changes, select Tools > Options > OpenOffice.org Calc > Changes.

Viewing Changes
Calc gives you tremendous control over what changes you see when reviewing a worksheet. To change the
available filters, select Edit > Changes > Show. The following dialog opens.

Using the different settings, you can control which changes appear on screen. You can filter based on:

Date - Only changes made in a certain time range are displayed.


Author - Only changes made by a specific author are displayed. This is especially useful if you have
multiple reviewers on the worksheet.
Range - Only changes made in a specific range of cells are displayed. This is especially useful if you
have a large spreadsheet and only want to review a part of it.
Comment - Searches the content of the comments and only displays changes which have comments that
match the search criteria.
Show accepted changes – Only changes you accepted are displayed.
Show rejected changes – Only changes you rejected are displayed.

You can also access the filter control in the Accept or Reject Changes dialog shown below. Click the Filter tab to
get a set of options similar to those shown in the figure above.

Adding Comments to Changes

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/7


myCBSEguide

Calc automatically adds to any recorded change a comment describing what was changed (for example, Cell B4
changed from ‘9’ to ‘4’). Reviewers and authors can add their comments to explain their changes.

To add a comment to a change:

1. Make the change to the spreadsheet.


2. Select the cell with the change.
3. Choose Edit > Changes > Comments. The dialog shown below appears. The automatically-added comment
provided by Calc appears in the title bar of this dialog and cannot be edited.
4. Type your own comment and click OK.

After you have added a comment to a changed cell, you can see it by hovering the mouse pointer over the cell.

The comment also appears in the dialog when you are accepting and rejecting changes.

Editing change comments

1. Select the cell with the comment that you want to edit.
2. Select Edit > Changes > Comments.
3. Edit the comment and click OK.

Accepting or Rejecting Changes


When you receive a worksheet back with changes, the beauty of the recording changes system becomes
evident. Now, as the original author, you can step through each change and decide how to proceed. To begin
this process:

1. Open the edited worksheet.


2. Select Edit > Changes > Accept or Reject. The dialog shown below opens.
3. Calc steps through the changes one at a time. You can choose to accept or reject each change as you go
through.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5/7


myCBSEguide

The Comment column by default contains an explanation of the change that was made. If the reviewer added a
comment to the change, it is displayed, followed by the description of the change.
If more than one person has reviewed the worksheet, one reviewer may have modified another reviewer’s
change. If so, the changes are hierarchically arranged with a plus sign for opening up the hierarchy.
On the Filter tab of this dialog (not shown here), you can choose how to filter the list of changes: by date, author,
cell range, or comments containing specific terms. After selecting the filter criteria, switch back to the List tab to
see the results.

Merging Worksheets
Sometimes, multiple reviewers return edited versions of a worksheet at the same time. In this case, it may be
quicker to review all of these changes at once, rather than one review at a time. For this purpose, Calc provides
the feature of merging worksheets. To merge worksheets, all of the edited worksheets need to have recorded
changes in them.

1. Open the original worksheet.


2. Select Edit > Changes > Merge Document.
3. A file selection dialog opens. Select a file you want to merge and click OK.
4. After the worksheets merge, the Accept or Reject Changes dialog opens as shown below, showing changes
by more than one reviewer. If you want to merge more worksheets, close the dialog and then repeat steps 2
and 3.

Now all of the changes are combined into one worksheet and you can accept or reject the changes. Changes
from different authors appear in different colors in the worksheet. In this example, all of the changes from
Robert are blue and the changes from Mia are red.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6/7


myCBSEguide

Comparing Documents
When sharing worksheets reviewers may forget to record the changes they make. This is not a problem with
Calc because Calc can find the changes by comparing worksheets. In order to compare worksheets, you need to
have the original worksheet and the one that is edited. To compare them:

1. Open the edited worksheet that you want to compare with the original worksheet.
2. Select Edit > Compare Document.
3. An open worksheet dialog appears. Select the original worksheet and click Insert.

Calc finds and marks the changes as follows:

All data that occurs in the edited worksheet but not in the original is identified as inserted.
All data that is in your original worksheet but is not in the edited worksheet is identified as deleted.
All data that is changed, is marked as changed.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 7/7


myCBSEguide

CBSE Class 10 Information Technology


Revision Notes
Electronic Spreadsheet (Advanced)
Macros In SpreadSheet

Relevant Knowledge
A macro is a saved sequence of commands or keystrokes that are stored for later use. An example of a simple
macro is one that “types” your address. The OpenOffice.org (OOo) macro language is very flexible, allowing
automation of both simple and complex tasks. Macros are especially useful to repeat a task the same way over
and over again.

Using the macro recorder


This session provides a basis for understanding the general macro capabilities in OpenOffice.org using the
macro recorder. The following steps create a macro that performs paste special with multiply.

1. Open a new spreadsheet.


2. Enter numbers into a sheet.

3. Select cell A3, which contains the number 3, and copy the value to the clipboard.
4. Select the range A1:C3.
5. Use Tools > Macros > Record Macro to start the macro recorder. The Record Macro dialog is displayed
with a stop recording button.

6. Use Edit > Paste Special to open the Paste Special dialog.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 1/8


myCBSEguide

7. Set the operation to Multiply and click OK. The cells are now multiplied by 3.

8. Click Stop Recording to stop the macro recorder. The OpenOffice.org Basic Macros dialog opens.
9. Select the current worksheet. For this example, the current Calc worksheet is Untitled 1. Existing
worksheets show a library named Standard. This library is not created until the worksheet is saved, or the
library is needed, so at this point your new worksheet does not contain a library. You can create a new
library to contain the macro, but this is not necessary.

10. Click New Module. If no libraries exist, then the Standard library is automatically created and used. In the
New Module dialog, type a name for the new module or leave the name as Module1.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 2/8


myCBSEguide

11. Click OK to create a module named Module1. Select the newly created Module1, enter the macro name
PasteMultiply and click Save.

12. The created macro is saved in Module1 of the Standard library in the Untitled 1 worksheet

Using A Macro As A Function


Using the newly created Calc worksheet CalcTestMacros.ods, enter the formula =NumberFive() (see Figure 2.44).
Calc finds the macro and calls it.

Note: Function names are not case sensitive. You can enter =NumberFive() and Calc clearly shows
=NUMBERFIVE().
Save the Calc document, close it, and open it again. Depending on your settings in Tools > Options >
OpenOffice.org > Security > Macro Security, Calc will display one of the warnings shown below. You will need to
click Enable Macros, or Calc will not allow any macros to be run inside the document.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 3/8


myCBSEguide

If you choose to disable macros, then when the document loads, Calc can no longer find the function.

When a document is created and saved, it automatically contains a library named Standard. The Standard
library is automatically loaded when the document is opened. No other library is automatically loaded.
Calc does not contain a function named NumberFive(), so it checks all opened and visible macro libraries for
the function. Libraries in OpenOffice.org Macros, My Macros, and the Calc document are checked for an
appropriately named function. The NumberFive() function is stored in the AuthorsCalcMacros library, which is
not automatically loaded when the document is opened.
Use Tools > Macros > Organize Macros > OpenOffice.org Basic to open the OpenOffice.org Basic Macros
dialog shown further down the page. Expand CalcTestMacros and find AuthorsCalcMacros. The icon for a
loaded library is a different color from the icon for a library that is not loaded.
Click the expansion symbol (usually a plus or a triangle) next to AuthorsCalcMacros to load the library. The icon
changes color to indicate that the library is now loaded. Click Close to close the dialog.
Unfortunately, the cells containing =NumberFive() are in error. Calc does not recalculate cells in error unless
you edit them or somehow change them. The usual solution is to store macros used as functions in the Standard
library. If the macro is large or if there are many macros, a stub with the desired name is stored in the Standard
library. The stub macro loads the library containing the implementation and then calls the implementation.

1. Use Tools > Macros > Organize Macros > OpenOffice.org Basic to open the OpenOffice.org Basic Macros
dialog. Select the NumberFive macro and click Edit to open the macro for editing.

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 4/8


myCBSEguide

2. Change the name of NumberFive to NumberFive_Implementation (see Listing 3).


Listing 3. Change the name of NumberFive to NumberFive_Implementation
Function NumberFive_Implementation()
NumberFive_Implementation() = 5
End Function
3. In the Basic IDE, hover the mouse cursor over the toolbar buttons to display the tool tips. Click the Select
Macro button to open the OpenOffice.org Basic Macros dialog.
4. Select the Standard library in the CalcTestMacros document and click New to create a new module. Enter a
meaningful name such as CalcFunctions and click OK. OOo automatically creates a macro named Main and
opens the module for editing.
5. Create a macro in the Standard library that calls the implementation function (see Listing 4). The new
macro loads the AuthorsCalcMacros library if it is not already loaded, and then calls the implementation
function.
Listing 4. Change the name of NumberFive to NumberFive_Implementation. Function NumberFive()
If NOT BasicLibraries.isLibraryLoaded("AuthorsCalcMacros") Then
BasicLibraries.LoadLibrary("AuthorsCalcMacros")
End If
NumberFive = NumberFive_Implementation()
End Function
Save, close, and reopen the Calc document. This time, the NumberFive() function works.

Passing Arguments to Macros


To illustrate a function that accepts arguments, we will write a macro that calculates the sum of its arguments
that are positive—it will ignore arguments that are less than zero (see Listing 5).
Listing 5. PositiveSum calculates the sum of the positive arguments.
Function PositiveSum(Optional x)
Dim TheSum As Double
Dim iRow As Integer
Dim iCol As Integer

TheSum = 0.0
If NOT IsMissing(x) Then
If NOT IsArray(x) Then
If x > 0 Then TheSum =x
Else
For iRow = LBound(x, 1) To UBound (x, 1)
For iCol = LBound(x, 2) To UBound (x, 2)
If x(iRow, iCol) > 0 Then TheSum = TheSum + x(iRow, iCol)
Next
Next
End If
End If
PositiveSum = TheSum
End Function
The macro in Listing 5 demonstrates a couple of important techniques.

1. The argument x is optional. If the argument is not optional and it is called without an argument, OOo prints

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 5/8


myCBSEguide

a warning message every time the macro is called. If Calc calls the function many times, then the error is
displayed many times.
2. IsMissing checks that an argument was passed before the argument is used.
3. IsArray checks to see if the argument is a single value, or an array. For example, = PositiveSum(7) or =
PositiveSum(A4). In the first case, the number 7 is passed as an argument, and in the second case, the value
of cell A4 is passed to the function.
4. If a range is passed to the function, it is passed as a two-dimensional array of values; for example,
=PositiveSum(A2:B5). LBound and UBound are used to determine the array bounds that are used. Although
the lower bound is one, it is considered safer to use LBound in case it changes in the future.
Note: The macro in Listing 5 is careful and checks to see if the argument is an array or a single argument.
The macro does not verify that each value is numeric. You may be as careful as you desire. The more things
you check, the more robust the macro is, and the slower it runs. Passing one argument is as easy as passing
two: add another argument to the function definition (see Listing 6). When calling a function with two
arguments, separate the arguments with a semicolon; for example, =TestMax(3; -4).

Listing 6. TestMax accepts two arguments and returns the larger of the two.
Function TestMax }(x, y)
If x >= y Then
TestMax = x
Else
TestMax = y
End If
End Function

Passing Arguments as Values


Arguments passed to a macro from Calc are always values. It is not possible to know what cells, if any, are used.
For example, =PositiveSum(A3) passes the value of cell A3, and PositiveSum has no way of knowing that cell A3
was used. If you must know which cells are referenced rather than the values in the cells, pass the range as a
string, parse the string, and obtain the values in the referenced cells.

Writing Macros that act like built-in Functions


Although Calc finds and calls macros as normal functions, they do not really behave as built-in functions. For
example, macros do not appear in the function lists. It is possible to write functions that behave as regular
functions by writing an Add-In.

Accessing Cells Directly


You can access the OOo internal objects directly to manipulate a Calc document. For example, the macro in
Listing 7 adds the values in cell A2 from every sheet in the current document. This Component is set by
StarBasic when the macro starts to reference the current document. A Calc document contains sheets:
ThisComponent.getSheets(). Use getCellByPosition(col, row) to return a cell at a specific row and column.
Listing 7. Add cell A2 in every sheet.
Function SumCellsAllSheets()
Dim TheSum As Double
Dim i As integer
Dim oSheets
Dim oSheet
Dim oCell
oSheets = ThisComponent.getSheets()

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 6/8


myCBSEguide

For i = 0 To oSheets.getCount() - 1
oSheet = oSheets.getByIndex(i)
oCell = oSheet.getCellByPosition (0, 1) ' GetCell A2
TheSum = TheSum + oCell.getValue()
Next
SumCellsAllSheets = TheSum
End Function

Sorting
Sorting data can be automated in Open Office by creating a Macro in Calc. Data can be sorted on a single
column or more than one column. Each time the Macro runs the data gets sorted. Such macros can be written
using code in Open Office. Consider sorting the data in the figure below. First, sort on column B descending and
then column A ascending.

The example in Listing 9, however, demonstrates how to sort on two columns.


Listing 9. Sort cells A1:C5 on Sheet 1.
Sub SortRange
Dim oSheet 'Calc sheet containing data to sort.
Dim oCellRange 'Data range to sort.

REM An array of sort fields determines the columns that are


REM sorted. This is an array with two elements, 0 and 1.
REM To sort on only one column, use:
REM Dim oSortFields(0) As New com.sun.star.util.SortField
Dim oSortFields(1) As New com.sun.star.util.SortField

REM The sort descriptor is an array of properties.


REM The primary property contains the sort fields.
Dim oSortDesc(0) As New com.sun.star.beans.PropertyValue

REM Get the sheet named "Sheet1"


oSheet = ThisComponent.Sheets.getByName("Sheet1")

REM Get the cell range to sort


oCellRange = oSheet.getCellRangeByName("A1:C5")

REM Select the range to sort.


REM The only purpose would be to emphasize the sorted data.
'ThisComponent.getCurrentController.select(oCellRange)

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 7/8


myCBSEguide

REM The columns are numbered starting with 0, so


REM column A is 0, column B is 1, etc.
REM Sort column B (column 1) descending.
oSortFields(0).Field = 1
oSortFields(0).SortAscending = FALSE

REM If column B has two cells with the same value,


REM then use column A ascending to decide the order.
oSortFields(1).Field = 0
oSortFields(1).SortAscending = True

REM Setup the sort descriptor.


oSortDesc(0).Name = "SortFields"
oSortDesc(0).Value = oSortFields()

REM Sort the range.


oCellRange.Sort(oSortDesc())
End Sub

Copyright © myCBSEguide.com. Mass distribution in any mode is strictly prohibited. 8/8

You might also like