PX-42F Spreadsheet

A spreadsheet for the PX-42F calculator, with Excel's formulas worked out in the calculator's own 34-digit decimals, and sheets saved as CSV files.

1. What it is

The Spreadsheet turns the PX-42F into a pocket spreadsheet: a grid of cells, A1 to Z999, where each cell holds a number, some text, or a formula that works something out from other cells. Change a number and every formula that depends on it changes too.

A budget: items, costs, quantities and totals
A budget sheet.
The function catalog
The function catalog, on XEQ.
Savings growing year by year, at 2 decimals
One row of formulas, filled down.

2. Getting started

Installing

  1. The calculator needs the PX-42F-Plus firmware with app API version 4 or later.
  2. On the calculator, open Settings → USB Drive → Connect to Computer.
  3. Copy SPREADSHEET.bin into BIN/APPS on the drive named PX-42F. From the project folder, make install does it.
  4. To try the examples, copy BUDGET.CSV and SAVINGS.CSV (in the project's sim/drive/BIN/APPS/SPREADSHEET/) into BIN/APPS/SPREADSHEET on the drive. Make the folder if it isn't there.
  5. Eject the drive, then press EXIT on the calculator.

Starting and leaving

Start it from Settings → Games & Apps → Apps → SPREADSHEET. It opens the sheet you had last, or an empty one called SHEET1 the first time.

To leave, press EXIT (the ON key). If the sheet has changes that aren't saved, it asks first:

Save changes to BUDGET?
ENTER saves, ← leaves without saving, EXIT goes back to the sheet.

If the Sleep Timer or an empty battery ends the app before you've saved, there's no time to ask. The changes are kept anyway, and the sheet comes back as you left it the next time you start the app. It says so on the bottom line; save it then to keep it.

3. The screen

The budget with a SUM in E6
The cursor on E7, below the SUM just entered in E6.

4. Moving around

As in the HP-42S's matrix editor, ▲ ▼ move up and down, and the first two keys of the menu, ← and → on the screen, move left and right. Held down, they repeat. The grid scrolls to keep the cursor in view.

KeyDoes
▲ ▼Up or down a row.
SHIFT ▲ ▼Up or down ten rows.
← → (menu)Left or right a column.
GOTO (menu)Goes to a cell by name: type it, such as C12, then ENTER.
ENTEREdits what's in the cell, on the top line.
← (backspace)Empties the cell.
EXITLeaves the app, asking first if there are changes to save.

The menus

The top row of keys works the menu on the bottom line. SHIFT shows the second menu, for one key.

The menu: left, right, GOTO, COPY, PASTE, FILE
← → GOTO COPY PASTE FILE
The SHIFT menu: WIDTH, FORMAT, CLEAR, CALC, HELP
SHIFT: WIDTH FORMAT CLEAR CALC HELP
Menu keyDoes
GOTOGoes to a cell by name.
COPYMarks a block to copy; COPY again copies it (section 8).
PASTEPuts what was copied at the cursor, or fills a marked block with it.
FILESave, Save as, Open, New sheet (section 10).
WIDTHThe cursor's column wider or narrower, with ▲ ▼.
FORMATHow numbers are shown: General, Fix or Sci.
CLEAREmpties the whole sheet, after asking.
CALCWorks every formula out again. Only RAND() gives a different answer.
HELPA page of the keys, on the calculator.

5. Typing

Starting

On the sheet, just start typing. A digit, . or an operator starts a new entry in the cursor's cell, in place of what was there:

ENTER stores the entry and moves the cursor down a row, ready for the next. EXIT drops it and leaves the cell as it was.

=D2/C typed on the top line
Typing =D2/C2 into E2: STO LOG 2 ÷ √x…
E2 shows 2.5 after ENTER
… 2 ENTER: E2 shows 2.5, and the cursor is on E3.

Two keyboards

While you type, the keys work as one of two keyboards. ALPHA (SHIFT ENTER) switches between them, and the bottom line says which is on: 123 or ABC. SHIFT before a key types its character on the other keyboard, once.

123 is for numbers and formulas. The digits and + − × ÷ (as * /) are where they're printed, and the keys around them type what formulas need. The top row types the column letters A to E, so =A1+B1 needs no SHIFT.

ABC is for text. Each key types the letter printed on it, as in the calculator's ALPHA keyboard.

NOTES typed on the ABC keyboard
ALPHA, then +/− E 4 LN ÷: NOTES.
GOTO with A12 typed
GOTO types on ABC: Σ+ SHIFT 1 SHIFT 2 is A12.

The other keys

KeyDoes, while typing
▲ ▼Move the cursor left and right in the entry. With SHIFT: to its start or end.
←Deletes the character before the cursor. SHIFT ← clears the entry.
XEQThe function catalog (on ABC: SHIFT XEQ).
RCLPoints at a cell or a block (on ABC: SHIFT RCL).
ENTERStores the entry. SHIFT ENTER (ALPHA): the other keyboard.
EXITDrops the entry.

The function catalog: XEQ

XEQ lists every function, with what it takes and what it gives. ▲ ▼ move through the list (with SHIFT, a page at a time), and a letter key jumps to the first function starting with that letter. ENTER types the function's name and its ( at the cursor; EXIT goes back without typing. The list opens where you last picked from it.

Pointing at cells: RCL

Instead of typing a cell's name, point at it. RCL puts a highlight on the grid; move it with ▲ ▼ or 8 2 (up and down) and 4 6 (left and right). . starts a block there: move to its other corner. ENTER types the cell's name, or the block's, such as D2:D4, and goes back to typing.

D2 to D4 marked, =SUM( on the top line
=SUM( from the catalog, then RCL, to D2, ., down to D4.
=SUM(D2:D4) on the top line
ENTER typed D2:D4; COS types the ).

When a formula can't be read

A formula that can't be read, such as =1+*2 or one with a ( left open, isn't stored. The calculator sounds its error tone, the entry stays on the top line, and its cursor is where reading stopped, to fix it there.

=1+*2 with the cursor on the star
The cursor is on the *.

6. Formulas

A formula starts with =. It's written as in Excel, so a sheet works the same there.

PartMeaning
12 -3.5 .25 6.02E23Numbers.
B2A cell's value. An empty cell is 0; one with text gives #VALUE!.
B2:D9A block, for functions such as SUM: from B2 to D9, row by row.
$B$2 B$2 $B2The same cell; the $ only matter when the formula is copied (section 8).
( )Grouping.
- in frontMinus. As in Excel it comes before ^: =-2^2 is 4.
% afterDivided by 100: =8% is 0.08.
^Power, left to right as in Excel: =2^3^2 is 64. It shows as ↑ on the screen, the HP-42S's own character.
* /Times, divided by.
+ -Plus, minus.
= <> < > <= >=Comparisons: 1 if true, 0 if false. TRUE and FALSE are 1 and 0.

Letters can be typed in either case: =sum(b2:b4) is =SUM(B2:B4). Spaces are allowed anywhere between the parts.

Errors

A formula that can't give an answer shows an error in its cell. A formula that uses that cell shows the same error.

ErrorMeaning
#DIV/0!A division by zero, or the AVERAGE of nothing.
#VALUE!Text where a number goes, or a block used as one number.
#REF!A cell past Z or row 999, or a copy that moved a name off the sheet.
#NAME?No function by that name.
#NUM!No answer (=SQRT(-1), =0^0) or too big.
#CIRC!The cell needs its own value, directly or through other cells.

Working it out

Every formula is worked out again after every change, in any order: a formula can use cells below or to the right of it, and chains of formulas hundreds of cells long work too.

7. Functions

The functions have Excel's names. Those marked values take any number of numbers, cells and blocks, separated by commas: =SUM(B2:B9,D2,100). In a block they skip text and empty cells, as Excel does.

FunctionGives
SUM(values)Total
AVERAGE(values)Mean
MIN(values)Smallest
MAX(values)Largest
COUNT(values)How many numbers
PRODUCT(values)All multiplied
STDEV(values)Standard deviation
AND(values)1 if none is 0
OR(values)1 if any isn't 0
IF(test,yes,no)yes if test isn't 0
ABS(x)Without its sign
SQRT(x)Square root
EXP(x)e to the x
LN(x)Natural logarithm
LOG(x,base)Logarithm, base 10
LOG10(x)Logarithm, base 10
SIN(x)Sine, x in radians
COS(x)Cosine, x in radians
TAN(x)Tangent, x in radians
ASIN(x)Arc sine
ACOS(x)Arc cosine
ATAN(x)Arc tangent
ATAN2(x,y)Angle of point x,y
SINH(x)Hyperbolic sine
COSH(x)Hyperbolic cosine
TANH(x)Hyperbolic tangent
PI()3.14159...
RADIANS(deg)Degrees to radians
DEGREES(rad)Radians to degrees
INT(x)Down to a whole number
TRUNC(x,digits)Cut after digits
ROUND(x,digits)Round to digits
MOD(a,b)Remainder, b's sign
POWER(a,b)a to the power b
FACT(n)n! = 1x2x...xn
GAMMA(x)Gamma, (x-1)!
SIGN(x)-1, 0 or 1
NOT(x)1 if x is 0
RAND()Random, 0 to 1

8. Copying and filling

To copy a block: COPY marks it from the cursor's cell; move to its other corner, then press COPY again. The bottom line says how big a block was copied. PASTE then puts it with its top left at the cursor, in place of what was there.

Names move with a copy. A formula copied one row down refers to the cells one row down: =B4*2 copied from C4 to C5 becomes =B5*2. A name with $ stays: =B4*$B$1 becomes =B5*$B$1. $B1 keeps its column and B$1 its row. A name moved off the sheet becomes #REF!.

Filling. Mark a block first (COPY, then move), then PASTE: what was copied is repeated to fill it. Copy one row of formulas, mark the rows below it, and PASTE fills them all, as Excel's fill down does.

Savings: a rate, a first year, and one row of formulas
SAVINGS.CSV: row 5 adds a year and the interest.
A5 to B5 marked
COPY, →: A5:B5 marked; COPY again copies it.
A6 to A14 marked
On A6, COPY and ▼ eight times marks A6:A14.
Rows 6 to 14 filled with years and balances
PASTE fills A6:B14, each row from the one above.

Emptying. ← empties the cursor's cell. With a block marked, ← or CLEAR in the menu empties the block. EXIT unmarks it.

9. Number format and widths

FORMAT (SHIFT menu) sets how numbers show, for the whole sheet:

Only the showing changes: every number keeps all its digits.

The list of number formats
FORMAT.
The budget in Fix 2
Fix 2.

WIDTH (SHIFT menu) makes the cursor's column wider with ▲ or narrower with ▼, from 3 to 30 characters; ENTER is done. Columns start 9 wide, and four fit on the screen.

Column A made 12 wide
Column A, 12 wide.

The app remembers the format and the widths, with the sheet you were on.

10. Files

Sheets are CSV files in BIN/APPS/SPREADSHEET on the calculator's drive, named NAME.CSV. FILE in the menu has:

ChoiceDoes
Save NAME.CSVSaves the sheet under its name.
Save as…Saves it under a new name, typed on ABC: up to 20 letters, digits, - or _. From then on the sheet has that name.
Open…Lists the .CSV files in the folder to open one. If the sheet has changes, it asks to save them first.
New sheetAn empty sheet, under a name you type. It asks about changes first.
The FILE choices
FILE.
Open, listing BUDGET
Open…

On a computer

In USB Drive mode, the sheets are in BIN/APPS/SPREADSHEET. A CSV file is the sheet as text, a row on each line, the cells separated by commas.

11. Limits

12. Quick reference

SHIFT HELP shows this on the calculator:

The help page
HELP.