LEFT / Nurse Practitioner

Extract Ward Code from Patient ID

I need to extract the first 3 characters from the 'Patient_ID' (e.g. PED-001) to identify the department. This helps in quickly sorting patients by ward for daily rounds or administrative tasks.

formula.xlsx
=LEFT(A2,3)

How it works: The LEFT function in Excel extracts a specified number of characters from the beginning (left side) of a text string. In this formula, `A2` refers to the cell containing the 'Patient_ID' (e.g., 'PED-001'), and `3` specifies that you want to extract the first three characters from that ID. This effectively isolates the ward code from the rest of the patient identifier.

Data Setup

Patient_ID Patient_Name
PED-001 Alice Smith
CAR-015 Bob Johnson
ICU-230 Charlie Brown
OBS-007 Diana Prince
ER-050 Eve Adams

Step-by-Step Guide

1

Open your Excel spreadsheet containing the patient data.

2

Select the cell where you want the extracted ward code to appear (e.g., cell B2, assuming 'Patient_ID' is in column A starting from A2).

3

Type the formula: `=LEFT(A2,3)`.

4

Press Enter to apply the formula. The ward code (e.g., 'PED') will appear in cell B2.

5

Click on cell B2 again, then drag the fill handle (the small square at the bottom-right corner of the cell) down to apply the formula to the rest of your patient IDs.