Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters =...

11
Page 1 Excel Text Functions MGMI 311

Transcript of Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters =...

Page 1: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 1

ExcelText Functions

MGMI 311

Page 2: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 2

Data Structure

• Text is Excel = Array of Characters= String (when coding)

• Text Function Array Operation

Page 3: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 3

ASCII code• Most computers use ASCII code to

represent text, which makes it possible to transfer data from one computer to another.

• American Standard Code for Information Interchange

• The standard ASCII code character set uses just 7 bits for each character

Page 4: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 4

CODE(text)

• Returns the ASCII value of a character or the first character in a cell

• i.e. the function will return the ASCII value for the first character and ignore all of the characters after the first.

Page 5: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 5

Array Function Vs. Excel Text

Array Function Excel Text Function

SIZE() Length of Array LENFirst() First element in an Array LEFT(Text,

Chars)Last() Last element in an Array RIGHT(Text,

Chars)Find

Page 6: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 6

FIND (Find_Text, Within_Text, Start_num)

• Returns the location of a substring in a string

• i.e. FIND is case-sensitive

SEARCH is not case-sensitive

If No Match, it will return #Value

SEARCH (Find_Text, Within_Text, Start_num)

Page 7: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 7

MID (text, Start, Chars)• Extract a substring from a string

(starting at any position)

Note

• Start = start position (default = 1)

• Chars = number of characters

Page 8: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 8

REPLACE (oldText,start_num, Num_chars,New_text)

• Replaces a sequence of characters in a string with another set of characters

Note• oldText = the original string value• Number_chars = the number of

characters to replace the oldText

Page 9: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 9

SUBSTITUTE (Text, oldText,newText, Instance_num)

• Replaces a set of characters with another

Note• Instance_num = n th appearance of

the oldText that you want to replace

Page 10: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 10

Text Functions• Concatenate (Text1, Text2,..., TextX)

• Exact (Text1, Text2)

• FIXED (Numbers, Decimals, No_comment)

• LEFT / RIGHT (Text, Char)

• LOWER (Text), PROPER (Text), UPPER (Text)

Page 11: Page 1 Excel Text Functions MGMI 311. Page 2 Data Structure Text is Excel = Array of Characters = String (when coding) Text Function  Array Operation.

Page 11

Logical Function

• Logical condition test : logical operators( return TRUE / FALSE ) e.g.

ISBLANK ISTEXT ISNONTEXT ISNUMBER ISEVEN / ISODD ISERROR