An array operation is an operation that touches or manipulates the values in an array directly. This can be a logical comparison, a math operation, concatenation , or even feeding an array into another function. In the example shown above, the following formulas appear, each representing a different type of array operation:
=B5:B13>6 // logical comparison
=B5:B13+1 // math operation
=B5:B13&"x" // concatenation
=INT(B5:B13) // another function
Array formulas include one or more array operations. The final result of an array formula can be a single value or multiple values.
Array operations and Excel 365
The distinctive feature of an array formula is that it includes an array operation, and there is a big difference in how array operations are handled in the current version of Excel versus older versions. In Excel 2019 and older, many formulas with array operations had to be entered with control + shift + enter to work properly. In Excel 365, arrays are native , and this is not necessary. In Legacy Excel , there are four functions that can natively handle array operations in an argument : SUMPRODUCT , LOOKUP , AGGREGATE , and INDEX *. These functions can be used to create array formulas that work without control + shift + enter in older versions of Excel.
Example
For example, the formula in D5 is:
=B5:B13>6
This is an array operation below compares values in the range B5:B13 to 6 with the greater than operator (>):
=B5:B14>6
This is a logical expression with an array that comes from the range B5:B13. Expanded, we have:
{3.3;6.1;9.7;7.2;2.3;6.2;4.9;5.4;9.7}>6
Because there are 9 cells in B5:B13, the result is an array with 9 TRUE or FALSE values:
{FALSE;TRUE;TRUE;TRUE;FALSE;TRUE;FALSE;FALSE;TRUE}
The numbers returned by the CHAR function in Excel come from ASCII. ASCII stands for “American Standard Code for Information Interchange” and is a 7-bit character set that contains characters from 0 to 127.
The original ASCII specification encodes 128 characters into numbers ( see table below ). These include the numbers 0 to 9, lowercase a-z, uppercase A-Z, and punctuation. The first 31 characters are non-printing “control codes”, most of which are no longer used, with the exception of the carriage return (13), line feed (10), and tab (9).
ASCII codes in Excel
Excel contains two functions designed to work with ASCII codes: the CHAR function and the CODE function. To specify a character according to its ASCII number, you can use the CHAR function like this:
=CHAR(65) // returns "A"
=CHAR(13) // carriage return
To return the ASCII number for a character, you can use the CODE function :
=CODE("A") // returns 65
Note: The Unicode character set is widely used these days on the web and in modern applications. Unlike ASCII, Unicode is a standard designed to support all of the world’s languages, and has many thousands of characters. Excel has two functions designed to work with this extended character set: UNICHAR and UNICODE .
ASCII codes
The table below shows standard printable ASCII characters and codes. The second table shows non-printable control codes .
| Character | Number | Notes |
|---|---|---|
| 32 | space character | |
| ! | 33 | exclamation mark |
| " | 34 | quotation mark |
| # | 35 | number sign |
| $ | 36 | dollar sign |
| % | 37 | percent sign |
| & | 38 | ampersand |
| ' | 39 | apostrophe |
| ( | 40 | left parenthesis |
| ) | 41 | right parenthesis |
| * | 42 | asterisk |
| + | 43 | plus sign |
| , | 44 | comma |
| - | 45 | hyphen |
| . | 46 | period |
| / | 47 | slash |
| 0 | 48 | digit 0 |
| 1 | 49 | digit 1 |
| 2 | 50 | digit 2 |
| 3 | 51 | digit 3 |
| 4 | 52 | digit 4 |
| 5 | 53 | digit 5 |
| 6 | 54 | digit 6 |
| 7 | 55 | digit 7 |
| 8 | 56 | digit 8 |
| 9 | 57 | digit 9 |
| : | 58 | colon |
| ; | 59 | semicolon |
| < | 60 | less-than |
| = | 61 | equals-to |
| > | 62 | greater-than |
| ? | 63 | question mark |
| @ | 64 | at sign |
| A | 65 | uppercase A |
| B | 66 | uppercase B |
| C | 67 | uppercase C |
| D | 68 | uppercase D |
| E | 69 | uppercase E |
| F | 70 | uppercase F |
| G | 71 | uppercase G |
| H | 72 | uppercase H |
| I | 73 | uppercase I |
| J | 74 | uppercase J |
| K | 75 | uppercase K |
| L | 76 | uppercase L |
| M | 77 | uppercase M |
| N | 78 | uppercase N |
| O | 79 | uppercase O |
| P | 80 | uppercase P |
| Q | 81 | uppercase Q |
| R | 82 | uppercase R |
| S | 83 | uppercase S |
| T | 84 | uppercase T |
| U | 85 | uppercase U |
| V | 86 | uppercase V |
| W | 87 | uppercase W |
| X | 88 | uppercase X |
| Y | 89 | uppercase Y |
| Z | 90 | uppercase Z |
| [ | 91 | left square bracket |
| \ | 92 | backslash |
| ] | 93 | right square bracket |
| ^ | 94 | caret |
| _ | 95 | underscore |
| ` | 96 | grave accent |
| a | 97 | lowercase a |
| b | 98 | lowercase b |
| c | 99 | lowercase c |
| d | 100 | lowercase d |
| e | 101 | lowercase e |
| f | 102 | lowercase f |
| g | 103 | lowercase g |
| h | 104 | lowercase h |
| i | 105 | lowercase i |
| j | 106 | lowercase j |
| k | 107 | lowercase k |
| l | 108 | lowercase l |
| m | 109 | lowercase m |
| n | 110 | lowercase n |
| o | 111 | lowercase o |
| p | 112 | lowercase p |
| q | 113 | lowercase q |
| r | 114 | lowercase r |
| s | 115 | lowercase s |
| t | 116 | lowercase t |
| u | 117 | lowercase u |
| v | 118 | lowercase v |
| w | 119 | lowercase w |
| x | 120 | lowercase x |
| y | 121 | lowercase y |
| z | 122 | lowercase z |
| { | 123 | left curly brace |
| | | 124 | vertical bar |
| } | 125 | right curly brace |
| ~ | 126 | tilde |
ASCII control codes
The table below shows the first 31 characters in ASCII, which are non-printing control codes. These codes were originally intended to control devices, and are no longer used, with the exception of the carriage return (13), line feed (10), and tab (9).
| Character | Number | Notes |
|---|---|---|
| NUL | 0 | null character |
| SOH | 1 | start of header |
| STX | 2 | start of text |
| ETX | 3 | end of text |
| EOT | 4 | end of transmission |
| ENQ | 5 | enquiry |
| ACK | 6 | acknowledge |
| BEL | 7 | bell (ring) |
| BS | 8 | backspace |
| HT | 9 | horizontal tab |
| LF | 10 | line feed |
| VT | 11 | vertical tab |
| FF | 12 | form feed |
| CR | 13 | carriage return |
| SO | 14 | shift out |
| SI | 15 | shift in |
| DLE | 16 | data link escape |
| DC1 | 17 | device control 1 |
| DC2 | 18 | device control 2 |
| DC3 | 19 | device control 3 |
| DC4 | 20 | device control 4 |
| NAK | 21 | negative acknowledge |
| SYN | 22 | synchronize |
| ETB | 23 | end transmission block |
| CAN | 24 | cancel |
| EM | 25 | end of medium |
| SUB | 26 | substitute |
| ESC | 27 | escape |
| FS | 28 | file separator |
| GS | 29 | group separator |
| RS | 30 | record separator |
| US | 31 | unit separator |
| DEL | 127 | delete control character |