MIDB function
a specific number of characters from a text string starting at the position you specify.
Text · Guided Excel example
Where can you use it?
Data preparation and reporting teams. Use this group to clean, split or reformat IDs, names and descriptions before using them in reports.
Scenario in the workbook
Extract two bytes starting at the second byte of an ASCII code.
A worked example from the workbook
| Row | A |
|---|---|
| 6 | Code |
| 7 | ABC-X |
| 8 | AB-42 |
| 9 | SKU-X |
Record 1
=MIDB(A7,2,2)Illustrative outputBC
See the inputs and instructions for all 3 examplesWorked examples
Extract two bytes starting at the second byte of an ASCII code.
Column F provides expressions as text. Satisfy the stated requirements, then paste into an empty Excel cell and compare with column G. The result was not verified in desktop Excel here.
| Row | A |
|---|---|
| 6 | Code |
| 7 | ABC-X |
| 8 | AB-42 |
| 9 | SKU-X |
| Trial | Expression | Sample output |
|---|---|---|
| Record 1 | =MIDB(A7,2,2) |
BC |
| Record 2 | =MIDB(A8,2,2) |
B- |
| Record 3 | =MIDB(A9,2,2) |
KU |