# 📊 Excel Formula Spotlight: First Name with Random Suffix Generator

If you're working in Excel and need a quick way to generate a **custom identifier** using a person's first name followed by a random number, this formula is a perfect solution.

---

### 🎯 What the Formula Does

```excel
=IF(ISNUMBER(SEARCH(" ", B2)), TEXTBEFORE(B2, " "), B2) & "@" & RANDBETWEEN(1000,99999)
```

It dynamically:

* Extracts the **first name** from a full name in cell `B2`,
    
* Appends an `"@"` symbol,
    
* Adds a **random number** (between 1000 and 99999).
    

---

### 🔍 Real-World Examples

| **Full Name (B2)** | **Generated Output** |
| --- | --- |
| `John Doe` | `John@27483` |
| `Asha` | `Asha@83917` |

Each time the sheet recalculates, the random number updates — great for generating **unique, non-sensitive identifiers** or **temporary usernames**.

---

### 🧠 How It Works

* `SEARCH(" ", B2)` → Looks for a space character in the cell (to check if there's a full name).
    
* `ISNUMBER(...)` → Returns TRUE if a space exists, meaning there’s a full name.
    
* `TEXTBEFORE(B2, " ")` → Extracts the first name from the full name.
    
* `B2` → If no space is found (i.e., just a first name), returns the whole value.
    
* `"@" & RANDBETWEEN(1000,99999)` → Adds an `@` and a **random number** between 1000 and 99999.
    

---

### 🛠️ Use Cases

* Quickly generate **test usernames** like `Asha@54321`
    
* Create **non-personal unique IDs** for events, forms, or demos
    
* Lightweight way to pseudo-anonymize user data in Excel
    

---

### 📝 Tips

* Want a fixed ID? Copy the result and use **Paste Special → Values** to lock it in.
    
* You can increase randomness by extending the number range (e.g., `100000` to `999999`).
    

---

Thanks for reading.
