32
document.xls Page 1 Extract data Extract Data Extracting elements of a cell. Most often used when one has imported a data file that needs to be "manipulated" to obtain the relevant information. The product of the Left, Right and Mid commands is a text string Example of data within a cell 1511 INV O 355806 134555.34 Invoice amount Customer # Invoice number Value Turns text to number Left This will get the customer # (In this case always 4 digits) To convert from text to a numeric value 1511 =LEFT(A5,4) 1511 =VALUE(LEFT(A5,4)) Text cell ref Number of characters to extract from the left Right This will get the invoice amount (Assumes in this case invoice cannot be >R999999.99) 134555.34 =RIGHT(A5,9) ### =VALUE(RIGHT(A5,9)) Text cell ref Number of characters to extract from the right Mid Returns a number of characters from a text string starting at the position you specify and then extracting a desired number of characters. 355806 =MID(A5,12,6) 355806 =VALUE(MID(A5,12,6)) Text cell ref Number of characters to extract ion of first character to be extracted A B C D E F G H I J K L M N 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Excel Formulas Revised

Embed Size (px)

Citation preview

Page 1: Excel Formulas Revised

document.xls Page 1

Extract data

Extract DataExtracting elements of a cell. Most often used when one has imported a data file that needs to be "manipulated" to obtain the relevant information.The product of the Left, Right and Mid commands is a text string

Example of data within a cell1511 INV O 355806 134555.34

Invoice amount Customer #

Invoice number ValueTurns text to number

LeftThis will get the customer # (In this case always 4 digits) To convert from text to a numeric value

1511 =LEFT(A5,4) 1511 =VALUE(LEFT(A5,4))Text cell ref Number of characters to extract from the left

RightThis will get the invoice amount (Assumes in this case invoice cannot be >R999999.99)

134555.34 =RIGHT(A5,9) 134,555.34 =VALUE(RIGHT(A5,9))Text cell ref Number of characters to extract from the right

MidReturns a number of characters from a text string starting at the position you specify and then extracting a desired number of characters.355806 =MID(A5,12,6) 355806 =VALUE(MID(A5,12,6))

Text cell refNumber of characters to extract

Position of first character to be extracted

A B C D E F G H I J K123456789

10111213141516171819202122232425262728293031

Page 2: Excel Formulas Revised

document.xls Page 2

Wildcards

Wildcards

Use To find

? (question mark)

For example, sm?th finds "smith" and "smyth"For example, p??l finds "pail" and "pool"

* (asterisk)

For example, *east finds "Northeast" and "Southeast"

~ (tilde) followed by ?, *, or ~

For example, fy91~? finds "fy91?"

To find text values that share some characters but not others, use a wildcard character. A wildcard character represents one or more unspecified characters.

Any single character in the same position as the question mark. I.e. the question mark represents a place holder.

Any number of characters in the same position as the asterisk

A question mark, asterisk, or tilde. I.e. the tilde indicates that the very next character must be read literally and not as a wildcard.

A B C D E F G H I1

2

3456

7

89

10

11

1213

14

151617

Page 3: Excel Formulas Revised

document.xls Page 3

Join data

ConcatenateJoins several text strings into one text string. (Up to 30)

Straun Kent Fotheringham

StraunKentFotheringham =CONCATENATE(A4,B4,C4) Long version of formula

StraunKentFotheringham =A4&B4&C4

Including spaces:Straun Kent Fotheringham =A4&" "&B4&" "&C4

Surname first, then first names:Fotheringham, Straun Kent =C4&", "&A4&" "&B4

& performs the same function as concatenate

A B C D E F123456789

1011121314

Page 4: Excel Formulas Revised

document.xls Page 4

Count formula and countif

Store City Store Type Transactions SalesBOSTON Company 3892 6,289 BOSTON Company 3966 6,571 BOSTON Franchise 3595 4,945 BOSTON Franchise 3611 5,051 LOS ANGELES Franchise 29,267 LOS ANGELES Company 31,947 NEW YORK Franchise 7293 24,077 NEW YORK Company 7037 22,704 NEW YORK Franchise 7815 26,962 NEW YORK Franchise 6935 22,925 NEW YORK Company 6954 22,389 NEW YORK Franchise 7531 25,324 NEW YORK Franchise 7486 24,753 NEW YORK Company 7285 24,112

277,316

COUNTWorks like sum but counts the number of entries (numbers) in the range

14 =COUNT(D2:D15)

COUNTAWorks like sum but counts the number of non-empty cells in the range

12 =COUNTA(C2:C15)

COUNTBLANKWorks like sum but counts the number of empty cells in the range

2 =COUNTBLANK(C2:C15)

COUNTIFCounts the number of cells within a range that meet a certain condition

8 =COUNTIF(A2:A15,"New York")

A B C D E F123456789

10111213141516

17181920212223242526272829303132

Page 5: Excel Formulas Revised

document.xls Page 5

Simple IF

100 100Logical test B15=C15

TRUE =IF(B15=C15,"TRUE","FALSE") This is the most simple if formula Value if true "TRUE"Value if false "FALSE"

A quicker method to determine if two cells are equal is as follows:

1 =B15=C15 This formula returns true if they are equal or false if they are not equal

Sales thrshold level 80,000 =IF(B29>=$B$25,B29*$B$27,B29*$B$26)Normal commission % 3%Commision if sales level met 5% Logical test B29>=$B$25 (70 000 >= 80 000 -> FALSE)

Sales Basic Salary Commision Total pay Value if true B29*$B$27 N/AEmployee 1 70,000 15,000 2,100 17,100 Value if false B29*$B$26 (70 000 * 3%)Employee 2 90,000 15,000 4,500 19,500 Employee 3 110,000 15,000 5,500 20,500 =IF(B30>=$B$25,B30*$B$27,B30*$B$26)Employee 4 80,000 15,000 4,000 19,000

Logical test (B30>$B$25 (90 000 >= 80 000 -> TRUE)Value if true B30*$B$27 (90 000 * 5%)Value if false B30*$B$26 N/A

Example 1 (To test if the contents of 2 cells is equal)

Example 2 (To test if the contents of a cell matches a condition. If condition met then do something to that cell)

A B C D E F G H I123456789101112131415161718192021222324252627282930313233343536

Page 6: Excel Formulas Revised

document.xls Page 6

Nested IFs

Sales threshold level 1 80,000 Super sales threhold level 100,000 Normal commission % 3%Commision if sales threhold level 1 is met 5%Commision if super sales threhold level is met 10%

Sales Basic Salary Commision Total payEmployee 1 100,000 15,000 10,000 25,000 Employee 2 90,000 15,000 4,500 19,500 Employee 3 110,000 15,000 11,000 26,000 Employee 4 80,000 15,000 4,000 19,000 Employee 5 70,000 15,000 2,100 17,100

=IF(B11>=$B$3,IF(B11>=$B$4,B11*$B$7,B11*$B$6),B11*$B$5)Logical test 1 B11>=$B$3 (90 000 >= 80 000 -> True)Logical test 2 B11>=$B$4 (90 000 >= 100 000 -> False)Value if logical 2 true B11*$B$7 N/AValue if logical 1 true B11*$B$6 (90 000 * 5% = 4 500)Value if logical 1 false B11*$B$5 N/A

=IF(B12>=$B$3,IF(B12>=$B$4,B12*$B$7,B12*$B$6),B12*$B$5)Logical test 1 B12>=$B$3 (110 000 >= 80 000 -> True)Logical test 2 B12>=$B$4 (110 000 >= 100 000 -> True)Value if logical 2 true B12*$B$7 (110 000 * 10% = 11 000)Value if logical 1 true B12*$B$6 N/AValue if logical 1 false B12*$B$5 N/A

=IF(B14>=$B$3,IF(B14>=$B$4,B14*$B$7,B14*$B$6),B14*$B$5)Logical test 1 B14>=$B$3 (70 000 >= 80 000 -> False)Logical test 2 B14>=$B$4 N/AValue if logical 2 true B14*$B$7 N/AValue if logical 1 true B14*$B$6 N/AValue if logical 1 false B14*$B$5 (70 000 * 3%)

Nested Ifs (More than one if within the same formula)A B C D E F

123456789

1011121314151617181920212223242526272829303132333435

Page 7: Excel Formulas Revised

document.xls Page 7

Negative sign to the right

Account code Description Amount (Note notice how the non numeric values are left aligned as they are read as text)100-101 Debtor A 1,002 1,002 100-102 Debtor B 407- (407)100-103 Debtor C 1,244 1,244 100-104 Debtor D 721- (721)100-105 Debtor E 234- (234)100-106 Debtor F 3,122 3,122

If cell does not contain "-" it then inserts the number from cell C3

Tests if cell contains textIf cell does not contain text then inserts the number from cell C3

If right most character a "-" then take the characters in the cell but the right most one and makes it negative

If contains text then checks if the right most charater is a "-"

=IF(ISTEXT(C3),IF(RIGHT(C3,1)="-",-VALUE(LEFT(C3,LEN(C3)-1)),C3),C3)

A B C D E F G H I J K L123456789

10111213141516171819

Page 8: Excel Formulas Revised

Useful excel formula.xls Page 8

Sumif example

Description Category AmountAudit fee current 1 21,170 Audit fee over provision in prior year 1 (500)Accounting and Admin Fees 2 12,345 Bank charges 2 6,474 Meetings and seminar expanses 3 29,578 Printing and Stationery 4 33,407 Direct payroll costs 5 1,144,444 Travelling & entertainment Expense 6 811,094 Subscriptions-other 3 4,083 Advertising And Promotions 6 307,717 Motor Vehicle Expenses 7 7,920 Legal Expenses 7 2,000 Public Relations 6 45,755 Staff Costs 5 521,319 Postage Telephones 4 24,512 External Consultants 2 15,339 Rent Lights & Water 7 22,222

3,008,879

Sum if category equals => 1 20,670 =SUMIF($B$2:$B$18,B21,$C$2:$C$18)2 34,158 3 33,661 4 57,919 Range Is the range of cells you want evaluated5 1,665,763 Criteria Condition that defines which cells are going to be added6 1,164,566 Sum range The range of cells that will be added7 32,142

3,008,879

Check 1

A B C D E F G H I J K L M123456789

10111213141516171819

202122232425262728

293031

Page 9: Excel Formulas Revised

Useful excel formula.xls Page 9

Sum positive balances

Amount>0

Account balance Jan Feb MarAmount Amount Amount

Account 1 0 2,000 1,000 Account 2 200 100 0 Account 3 (470) (823) (1,058)Account 4 (294) (646) 0 Account 5 1,000 800 600

Positive balances 1,200 2,900 1,600

This formula is explained in detail on a separate sheet

Note this is an array formula and must be entered using the following keyboard combination : Ctrl+Shift+Enter Do not type in the {}. By pressing Ctrl+Shift+Enter excel enters the necessary brackets around the formula.

=DSUM(E4:E10,1,$B$1:$B$2)

{=SUM(IF(D4:D10>0,D4:D10,0))}

=SUMIF(C4:C10,">0")

A B C D E F G H I J123456789

101112131415161718192021

Page 10: Excel Formulas Revised

document.xls Page 10

DSum

Year Period Store Code Store City Store Type Transactions Sales1998 1 BO-1 BOSTON Company 3881 6,248 1998 1 BO-2 BOSTON Company 3789 5,722 1998 1 BO-3 BOSTON Company 3877 6,278 1998 1 BO-4 BOSTON Company 3862 6,123 1998 1 BO-5 BOSTON Franchise 4013 6,861 1998 1 BO-6 BOSTON Franchise 3620 5,039 1998 2 BO-1 BOSTON Company 3948 6,468 1998 2 BO-2 BOSTON Company 3878 6,301 1998 2 BO-3 BOSTON Company 3911 6,390 1998 2 BO-4 BOSTON Company 3926 6,438 1998 2 BO-5 BOSTON Franchise 3990 6,767 1998 2 BO-6 BOSTON Franchise 3615 5,091 1998 3 BO-1 BOSTON Company 3936 6,307 1998 3 BO-2 BOSTON Company 3857 6,153 Database Is the range of cells you want evaluated and summed1998 3 BO-3 BOSTON Company 3898 6,319 Field Either the label of the column to be evaluated or the column number1998 3 BO-4 BOSTON Company 3949 6,453 Criteria Is the range of the cells which contains the conditions you want to apply1998 3 BO-5 BOSTON Franchise 3617 5,052 1998 3 BO-6 BOSTON Franchise 3624 5,111 1998 4 BO-1 BOSTON Company 3853 6,021 Example: Sum where Store City = Boston and Store Type = Franchise1998 4 BO-2 BOSTON Company 3891 6,333 1998 4 BO-3 BOSTON Company 3892 6,289 Formula Store City Store Type1998 4 BO-4 BOSTON Company 3966 6,571 80,512 Boston Franchise1998 4 BO-5 BOSTON Franchise 3595 4,945 1998 4 BO-6 BOSTON Franchise 3611 5,051 1998 1 LA-1 LOS ANGELES Franchise 8259 29,267 1998 1 LA-2 LOS ANGELES Company 9140 31,947 1998 1 LA-3 LOS ANGELES Company 9727 35,405 1998 1 LA-4 LOS ANGELES Franchise 9494 33,830 1998 1 LA-5 LOS ANGELES Franchise 10644 39,971 1998 1 LA-6 LOS ANGELES Franchise 10649 40,077 1998 2 LA-1 LOS ANGELES Franchise 9066 32,595 1998 2 LA-2 LOS ANGELES Company 9789 35,217 1998 2 LA-3 LOS ANGELES Company 9814 35,455 1998 2 LA-4 LOS ANGELES Franchise 9917 35,926 1998 2 LA-5 LOS ANGELES Franchise 10617 39,424 1998 2 LA-6 LOS ANGELES Franchise 10190 38,387 1998 3 LA-1 LOS ANGELES Franchise 9531 33,966 1998 3 LA-2 LOS ANGELES Company 9698 34,419 1998 3 LA-3 LOS ANGELES Company 9771 34,494 1998 3 LA-4 LOS ANGELES Franchise 10232 37,315 1998 3 LA-5 LOS ANGELES Franchise 10561 39,141 1998 3 LA-6 LOS ANGELES Franchise 10924 41,938 1998 4 LA-1 LOS ANGELES Franchise 9310 33,202 1998 4 LA-2 LOS ANGELES Company 9496 33,910 1998 4 LA-3 LOS ANGELES Company 9596 34,500 1998 4 LA-4 LOS ANGELES Franchise 10050 37,274 1998 4 LA-5 LOS ANGELES Franchise 10440 38,304 1998 4 LA-6 LOS ANGELES Franchise 10778 40,965

=DSUM(B1:G145,G1,K22:L23)

A B C D E F G H I J K L M N O123456789

10111213141516171819202122

232425262728293031323334353637383940414243444546474849

Page 11: Excel Formulas Revised

document.xls Page 11

DSum

1998 1 NY-1 NEW YORK Company 6390 19,890 1998 1 NY-2 NEW YORK Franchise 7016 22,229 1998 1 NY-3 NEW YORK Franchise 7293 24,077 1998 1 NY-4 NEW YORK Company 7037 22,704 1998 1 NY-5 NEW YORK Franchise 7815 26,962 1998 1 NY-6 NEW YORK Franchise 6935 22,925 1998 2 NY-1 NEW YORK Company 6954 22,389 1998 2 NY-2 NEW YORK Franchise 7531 25,324 1998 2 NY-3 NEW YORK Franchise 7486 24,753 1998 2 NY-4 NEW YORK Company 7285 24,112 1998 2 NY-5 NEW YORK Franchise 7749 26,325 1998 2 NY-6 NEW YORK Franchise 6881 23,123 1998 3 NY-1 NEW YORK Company 7256 23,330 1998 3 NY-2 NEW YORK Franchise 7330 24,258 1998 3 NY-3 NEW YORK Franchise 7212 23,386 1998 3 NY-4 NEW YORK Company 7480 24,619 1998 3 NY-5 NEW YORK Franchise 6771 22,189 1998 3 NY-6 NEW YORK Franchise 6954 23,188 1998 4 NY-1 NEW YORK Company 7086 22,703 1998 4 NY-2 NEW YORK Franchise 7275 24,245 1998 4 NY-3 NEW YORK Franchise 7121 23,025 1998 4 NY-4 NEW YORK Company 7562 25,329 1998 4 NY-5 NEW YORK Franchise 6569 20,845 1998 4 NY-6 NEW YORK Franchise 6973 23,220 1997 1 BO-1 BOSTON Company 3234 5,206 1997 1 BO-2 BOSTON Company 3157 4,768 1997 1 BO-3 BOSTON Company 3230 5,231 1997 1 BO-4 BOSTON Company 3218 5,102 1997 1 BO-5 BOSTON Franchise 3344 5,717 1997 1 BO-6 BOSTON Franchise 3016 4,199 1997 2 BO-1 BOSTON Company 3290 5,390 1997 2 BO-2 BOSTON Company 3231 5,250 1997 2 BO-3 BOSTON Company 3259 5,325 1997 2 BO-4 BOSTON Company 3271 5,365 1997 2 BO-5 BOSTON Franchise 3325 5,639 1997 2 BO-6 BOSTON Franchise 3012 4,242 1997 3 BO-1 BOSTON Company 3280 5,255 1997 3 BO-2 BOSTON Company 3214 5,127 1997 3 BO-3 BOSTON Company 3248 5,265 1997 3 BO-4 BOSTON Company 3290 5,377 1997 3 BO-5 BOSTON Franchise 3014 4,210 1997 3 BO-6 BOSTON Franchise 3020 4,259 1997 4 BO-1 BOSTON Company 3210 5,017 1997 4 BO-2 BOSTON Company 3242 5,277 1997 4 BO-3 BOSTON Company 3243 5,240 1997 4 BO-4 BOSTON Company 3305 5,475 1997 4 BO-5 BOSTON Franchise 2995 4,120 1997 4 BO-6 BOSTON Franchise 3009 4,209 1997 1 LA-1 LOS ANGELES Franchise 6882 24,389

A B C D E F G H I J K L M N O50515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798

Page 12: Excel Formulas Revised

document.xls Page 12

DSum

1997 1 LA-2 LOS ANGELES Company 7616 26,622 1997 1 LA-3 LOS ANGELES Company 8105 29,504 1997 1 LA-4 LOS ANGELES Franchise 7911 28,191 1997 1 LA-5 LOS ANGELES Franchise 8870 33,309 1997 1 LA-6 LOS ANGELES Franchise 8874 33,397 1997 2 LA-1 LOS ANGELES Franchise 7555 27,162 1997 2 LA-2 LOS ANGELES Company 8157 29,347 1997 2 LA-3 LOS ANGELES Company 8178 29,545 1997 2 LA-4 LOS ANGELES Franchise 8264 29,938 1997 2 LA-5 LOS ANGELES Franchise 8847 32,853 1997 2 LA-6 LOS ANGELES Franchise 8491 31,989 1997 3 LA-1 LOS ANGELES Franchise 7942 28,305 1997 3 LA-2 LOS ANGELES Company 8081 28,682 1997 3 LA-3 LOS ANGELES Company 8142 28,745 1997 3 LA-4 LOS ANGELES Franchise 8526 31,095 1997 3 LA-5 LOS ANGELES Franchise 8800 32,617 1997 3 LA-6 LOS ANGELES Franchise 9103 34,948 1997 4 LA-1 LOS ANGELES Franchise 7758 27,668 1997 4 LA-2 LOS ANGELES Company 7913 28,258 1997 4 LA-3 LOS ANGELES Company 7996 28,750 1997 4 LA-4 LOS ANGELES Franchise 8375 31,061 1997 4 LA-5 LOS ANGELES Franchise 8700 31,920 1997 4 LA-6 LOS ANGELES Franchise 8981 34,137 1997 1 NY-1 NEW YORK Company 5325 16,575 1997 1 NY-2 NEW YORK Franchise 5846 18,524 1997 1 NY-3 NEW YORK Franchise 6077 20,064 1997 1 NY-4 NEW YORK Company 5864 18,920 1997 1 NY-5 NEW YORK Franchise 6512 22,468 1997 1 NY-6 NEW YORK Franchise 5779 19,104 1997 2 NY-1 NEW YORK Company 5795 18,657 1997 2 NY-2 NEW YORK Franchise 6275 21,103 1997 2 NY-3 NEW YORK Franchise 6238 20,627 1997 2 NY-4 NEW YORK Company 6070 20,093 1997 2 NY-5 NEW YORK Franchise 6457 21,937 1997 2 NY-6 NEW YORK Franchise 5734 19,269 1997 3 NY-1 NEW YORK Company 6046 19,441 1997 3 NY-2 NEW YORK Franchise 6108 20,215 1997 3 NY-3 NEW YORK Franchise 6010 19,488 1997 3 NY-4 NEW YORK Company 6233 20,515 1997 3 NY-5 NEW YORK Franchise 5642 18,490 1997 3 NY-6 NEW YORK Franchise 5795 19,323 1997 4 NY-1 NEW YORK Company 5905 18,919 1997 4 NY-2 NEW YORK Franchise 6062 20,204 1997 4 NY-3 NEW YORK Franchise 5934 19,187 1997 4 NY-4 NEW YORK Company 6301 21,107 1997 4 NY-5 NEW YORK Franchise 5474 17,370 1997 4 NY-6 NEW YORK Franchise 5810 19,350

A B C D E F G H I J K L M N O99

100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145

Page 13: Excel Formulas Revised

document.xls Page 13

Sum sheets

Divisions 1 to 4January February March April May June

Account 1 20,534 28,233 11,772 17,118 15,644 24,489 Account 2 24,303 19,720 13,387 20,084 11,961 11,253 Account 3 20,521 23,944 26,317 10,892 19,318 18,599 Account 4 12,830 23,127 13,332 15,274 31,819 28,759 Account 5 9,813 18,275 28,468 24,222 10,072 15,812

88,001 113,299 93,276 87,590 88,814 98,912

Correct version of the formula=SUM('Division 1:Division 4'!B3)Sums cell B3 on every sheet in the range division 1 to division 4.

Incorrect version of the formula='Division 1'!B3+'Division 2'!B3+'Division 3'!B3+'Division 4'!B3Just think if you had 50 divisions!

Benefits of using the correct version

If you want to exclude a sheet (say division 2) all you do is click on the sheet tab for division 2 and drag it out of the current range being summed. If you then want to re-include it just drag it back within the range being added. The formulas are all updated automatically.

The only thing to bear in mind is when you move either of the sheets on the extremities of the formula. In this case I refer to Division 1 or Division 4. These will be the end markers of the formula and if one moved say Division 4 one sheet to the right you would then include an extra sheet.

A B C D E F G12345678

91011121314151617181920212223242526

Page 14: Excel Formulas Revised

document.xls Page 14

Division 1

Division 1January February March April May June

Account 1 8,040 8,037 1,937 7,178 2,989 6,730 Account 2 7,148 1,199 5,059 9,472 2,838 778 Account 3 8,594 6,549 7,485 5,481 4,254 3,598 Account 4 5,364 329 740 4,719 7,596 6,563 Account 5 1,424 6,756 9,261 3,796 2,206 6,282

30,570 22,870 24,482 30,646 19,883 23,951

A B C D E F G12345678

Page 15: Excel Formulas Revised

document.xls Page 15

Division 2

Division 2January February March April May June

Account 1 3,342 9,665 926 8,064 7,128 4,645 Account 2 7,809 6,900 964 2,547 6,995 417 Account 3 8,257 7,189 8,451 1,639 8,056 2,349 Account 4 2,573 5,728 4,175 1,129 8,441 8,142 Account 5 2,429 2,484 4,475 7,001 3,326 3,397

24,410 31,966 18,991 20,380 33,946 18,950

A B C D E F G12345678

Page 16: Excel Formulas Revised

document.xls Page 16

Division 3

Division 3January February March April May June

Account 1 8,724 8,527 5,260 639 2,701 9,760 Account 2 723 2,445 2,273 7,163 214 1,902 Account 3 1,273 7,255 9,553 3,730 3,319 7,264 Account 4 2,489 8,875 1,013 6,370 8,904 7,274 Account 5 5,534 1,497 8,658 4,962 4,329 5,211

18,743 28,599 26,757 22,864 19,467 31,411

A B C D E F G12345678

Page 17: Excel Formulas Revised

document.xls Page 17

Division 4

Division 4January February March April May June

Account 1 428 2,004 3,649 1,237 2,826 3,354 Account 2 8,623 9,176 5,091 902 1,914 8,156 Account 3 2,397 2,951 828 42 3,689 5,388 Account 4 2,404 8,195 7,404 3,056 6,878 6,780 Account 5 426 7,538 6,074 8,463 211 922

14,278 29,864 23,046 13,700 15,518 24,600

A B C D E F G12345678

Page 18: Excel Formulas Revised

document.xls Page 18

Vlookup

Lookup value D17Table array $A$17:$B$31Column index number 2Range lookup 0

Psoft # NamePsoft # Name 1001241 Moodley,Wentzel =VLOOKUP(D17,$A$17:$B$31,2,FALSE)

1000693 Fotheringham,Straun Kent 1002250 Ridl,Christopher Walter1000757 Comber,Michael John 1002609 Sheasby,Milinda1000840 De Busser,Robert Frank1000846 Carter,Sebastian Benedikt Field Note1001241 Moodley,Wentzel1001340 Rein,Christopher James False is used 99.9% of the time1001914 Kruger,Gavin Dykes1002154 McArthur,Donald This also assumes the range is sorted in ascending order1002250 Ridl,Christopher Walter1002256 Sagar,Craig Archer e.g. of nearest match1002286 Waller,Andrew Geard Psoft # Name1002481 Malherbe,Francois Jacques 1000799 Comber,Michael John =VLOOKUP(D30,$A$17:$B$31,2,TRUE)1002483 Botes,Brian1002609 Sheasby,Milinda

Results should have been: (#N/A means no match found)1000799 #N/A =VLOOKUP(D35,$A$17:$B$31,2,FALSE)

FALSE in the range lookup looks for exact matches

If left out or TRUE is used then it finds the nearest match

It finds the match after 1000799 I.e. 1000840 and then goes back to the cell before this I.e. 1000757. In this case it is not appropriate to use the nearest match. (See next sheet for an example where nearest match may apply)

A B C D E F G H I123456789

101112131415161718192021222324252627282930313233343536

Page 19: Excel Formulas Revised

document.xls Page 19

Vlookup (nearest)

Tax tablesSalary Tax rate Tax on first bands

0 18% - 40,000 25% 7,200 80,000 30% 17,200

110,000 35% 26,200 170,000 38% 47,200 240,000 40% 73,800

Taxation due

195,000 38% 56,700

=VLOOKUP(A12,$A$2:$C$8,2,TRUE)

=VLOOKUP(A12,$A$2:$C$8,3,TRUE)+(A12-VLOOKUP(A12,$A$2:$B$8,1,TRUE))*B12

Enter Taxable income

Rate of tax applicable

Here 195 000 is greater 170 000 so it goes to the next value, being 240 000 and finds that 240 000 is greater than 195 000 so it goes back to the next nearest match, being 170 000 and finds the rate applicable at that level which is 40%.

A B C D E F123456789

10

11

1213141516171819202122

Page 20: Excel Formulas Revised

document.xls Page 20

Rounding

Round NumberRounds a number to a specified number of digits 1,544.5459

Round to 2 decimals 1,544.5500 =ROUND(B2,2)

Round to the nearest rand 1,545.0000 =ROUND(B2,0)

Round to the nearest ten rand 1,540.0000 =ROUND(B2,-1)

Round to the nearest hundred rand 1,500.0000 =ROUND(B2,-2)

Round to the nearest thousand rand 2,000.0000 =ROUND(B2,-3)

Roundup NumberAlways rounds a number up towards zero 1,123.4594

Roundup to the nearest rand 1,124.0000 =ROUNDUP(B16,0)

Roundup to the nearest hundred rand 1,200.0000 =ROUNDUP(B16,-2)

Rounddown NumberAlways rounds a number down towards zero 1,473.5934

Rounddown to the nearest rand 1,473.0000 =ROUNDDOWN(B24,0)

Rounddown to the nearest hundred rand 1,400.0000 =ROUNDDOWN(B24,-2)

A B C D E123456789

10111213141516171819202122232425262728

Page 21: Excel Formulas Revised

document.xls Page 21

Compare data

List 1 List 21 50.50 4 30.00 2 1,150.00 5 40.00 3 40.00 6 20.00 4 30.00 1 50.40 5 30.00 2 1,125.00 6 20.00 3 40.00

Exact matchesItem List 1 List 2

1 50.50 50.40 02 1,150.00 1,125.00 03 40.00 40.00 14 30.00 30.00 15 30.00 40.00 06 20.00 20.00 1

Comparing to the nearest randItem List 1 List 2

1 50.00 50.00 12 1,150.00 1,125.00 03 40.00 40.00 14 30.00 30.00 15 30.00 40.00 06 20.00 20.00 1

Comparing to the nearest hundred randItem List 1 List 2

2 1,100.00 1,100.00 1

=VLOOKUP(A11,$D$2:$E$7,2,FALSE)

=ROUNDDOWN(VLOOKUP(A20,$D$2:$E$7,2,FALSE),0)

=ROUNDDOWN(B2,0)

=ROUNDDOWN(B3,-2)

=ROUNDDOWN(VLOOKUP(A29,$D$2:$E$7,2,FALSE),-2)

=B13=C13

Page 22: Excel Formulas Revised

document.xls Page 22

FIX #DIV ERROR

Account 1 200,000 150,000 Err:511Account 2 1,333,000 1,300,000 Err:511Account 3 25,000 12,000 Err:511Account 4 10,000 - Err:511

PDIF=IF(D3=0,"-",PDIF(B3,D3))The IF statement checks for zeros to prevent the #DIV/0! error messageSyntax:PDIF(number 1, number 2)

This calculates the percentage difference between values contained in two different cellsThe most common formula used outside of AS/2 would have been as follows:=IF(D3=0,"-",(B3-D3)/D3)

CurrentYear20XX

PriorYear20XY

Difference %

A B C D E F G H

1

23456789

101112131415161718

Page 23: Excel Formulas Revised

document.xls Page 23

XFOOT

January February March April May June TotalAccount 1 428 2,004 3,649 1,237 2,826 3,354 13,498 Account 2 8,623 9,176 5,091 902 1,914 8,156 33,862 Account 3 2,397 2,951 828 42 3,689 5,388 15,295

11,448 14,131 9,568 2,181 8,429 16,898 Err:511

XFOOT=XFOOT(H2:H6,B7:G7)SyntaxXFOOT(range 1, range 2)

This function is very useful to perform both the cross cast and the downwards cast of the totals. See error in example belowWithout XFOOT, just summing the downwards cast in the total column does not readily identify the formula problem that exist in the first row.

January February March April May June TotalAccount 1 428 2,004 3,649 1,237 2,826 3,354 10,144 Account 2 8,623 9,176 5,091 902 1,914 8,156 33,862 Account 3 2,397 2,951 828 42 3,689 5,388 15,295

11,448 14,131 9,568 2,181 8,429 16,898 59,301

Using XFOOT as below your attention is drawn to the fact that there is an error in one of the formula.

January February March April May June TotalAccount 1 428 2,004 3,649 1,237 2,826 3,354 10,144 Account 2 8,623 9,176 5,091 902 1,914 8,156 33,862 Account 3 2,397 2,951 828 42 3,689 5,388 15,295

11,448 14,131 9,568 2,181 8,429 16,898 Err:511

A B C D E F G H I J K12345

6789

10111213141516171819

2021222324252627

28

Page 24: Excel Formulas Revised

AS/2 Shortcuts and some other general ones.

Transfer in docAlt + O +I

Transfer out docAlt + O + O

CutCtrl + X

CopyCtrl + C

PasteCtrl + V

Paste TB LinkCtrl + Alt + L

Update TB linksCtrl + Alt + F9

View adjusting journal in leadsheet (how it looks in TB tools with the description) This will be handy for reviewing.Ctrl + Alt + A

View reclassifying journal in leadsheet (how it looks in TB tools with the description)Ctrl + Alt + J

Show desktopWindows key + D

Open My ComputerWindows key + E

Lock computerWindows key + L

Switch between applicationsAlt + Tab

Switch between excel documentsCtrl + Tab

Switch between excel tabsCtrl + page up or Ctrl + page down

Page 25: Excel Formulas Revised

Get into cellF2

Rename AS/2 documentF2 (in AS/2 window)

Switch between word documentsCtrl + F6

Repeat last action performed (like fill cell with yellow colour)F4

Close any document and saveAlt + F4

Backup window in AS/2Alt + F + B

Copy numeric referenceCtrl + Alt + U

Paste numeric referenceCtrl + Alt + F

Insert new document window in AS/2Insert

New section in AS/2Alt + insert

Find document in AS/2 windowF3

Sign off as preparerAlt + Ctrl +P

Sign off as reviewAlt + Ctrl +S

Close audit fileAlt + F + C

Raise review noteCtrl + Alt + W

Page 26: Excel Formulas Revised

Close review noteCtrl + Alt + H

Sign off in MapCtrl + Alt + NShow tickmarck boxCtrl + Alt + T

Copy text reference Ctrl + Alt + C

Paste text referenceCtrl + Alt + R

Create insightCtrl + Alt + I

Make BoldCtrl + B

ItalicCtrl + I

UnderlineCtrl + U

Format cells menuCtrl + 1

UndoCtrl + Z

PrintCtrl + P

Insert columnAlt + I + C

Insert RowAlt + I + R

Insert CellAlt + I + E

Here are some TB Tools shorcuts for the more experienced guys

Page 27: Excel Formulas Revised

Calculate Now F9 Recalculates the trial balance document.

Clear DEL Clears the data from the highlighted area.

Close CTRL+F4 Exits the Trial Balance module.

Delete Account CTRL+DELDeletes the selected account.

Insert Account INS Inserts an account above the selected account.

Journal Set CTRL+J Opens the journal set for the selected journal column.

Journal Trail CTRL+T Lists the journal entries included in the selected net journal.

Print to Workpaper CTRL+P Prints to an Excel workpaper.

Save CTRL+S Saves the data in the trial balance document.

Find CTRL+G Find the account number that your looking for

If you really want to be super fast you can also use these additional ones which I find to be very handy at times.

ALT+TABSwitch to the next program.

CTRL+F9Minimize a workbook window to an icon.

CTRL+F10Maximize or restore the selected workbook window.

PRTSCRCopy a picture of the screen to the Clipboard.

HOMEMove to the beginning of the row.

CTRL+HOMEMove to the beginning of the worksheet.

PAGE DOWNMove down one screen.

PAGE UPMove up one screen.

ALT+PAGE DOWN

Page 28: Excel Formulas Revised

Move one screen to the right.

ALT+PAGE UPMove one screen to the left

CTRL + FLaunch find function

SHIFT+F4

CTRL+SPACEBARSelect the entire column.

SHIFT+SPACEBARSelect the entire row.

CTRL+ASelect the entire worksheet.

CTRL+DFill down.

CTRL+RFill to the right.

CTRL+ZUndo the last action.

CTRL+CCopy the selected cells.

CTRL+XCut the selected cells.

CTRL+VPaste copied cells.

DELETEClear the contents of the selected cells.

CTRL+HYPHENDelete the selected cells.

CTRL+1

Repeat the last Find action (same as Find Next).

Display the Format Cells dialog box.

Page 29: Excel Formulas Revised

CTRL+SHIFT+~Apply the General number format.

CTRL+SHIFT+$Apply the Currency format with two decimal places (negative numbers in parentheses).

CTRL+SHIFT+%Apply the Percentage format with no decimal places.

CTRL+BApply or remove bold formatting.

CTRL+IApply or remove italic formatting.

CTRL+UApply or remove underlining.

CTRL+SHIFT+&Apply the outline border to the selected cells.

CTRL+SHIFT+_Remove the outline border from the selected cells.

Sorry but I ran out of anymore usefull ones.

Page 30: Excel Formulas Revised

View adjusting journal in leadsheet (how it looks in TB tools with the description) This will be handy for reviewing.

Page 31: Excel Formulas Revised

If you really want to be super fast you can also use these additional ones which I find to be very handy at times.

Page 32: Excel Formulas Revised

Apply the Currency format with two decimal places (negative numbers in parentheses).