Skip to main content

Command Palette

Search for a command to run...

πŸ“Š Excel Formula Spotlight: First Name with Random Suffix Generator

Excel Trick: Extract First Name and Add Random Numbers Dynamically

Published
β€’2 min read
πŸ“Š Excel Formula Spotlight: First Name with Random Suffix Generator
V

With over 9 years of experience as in IT, I have led technology operations across diverse industries, ensuring robust IT infrastructure, network security, and team development.

My expertise spans managing IT infrastructure & operations, IT policy, and backup/disaster recovery. My expertise also includes IT asset management, Google Workspace & Office 365, endpoint security, DLP, and cross-platform systems (Windows/Linux/Mac OS) etc.

Additionally, I hold certifications in Google IT Support, CCNA, and IBM Cybersecurity, reinforcing my commitment to continuous learning and delivering robust technology solutions.

Thank you for your time and consideration.

Best regards, Vishal Mathur

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

=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 DoeJohn@27483
AshaAsha@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.

More from this blog

What Are Tokens β€” And Why Should You Care?

The hidden unit of measurement that shapes every conversation you have with Claude. You type a message to Claude. You hit send. A response flows back in seconds. Simple, right? But beneath that seamless exchange, something interesting is happening β€” your words are being sliced into tiny linguistic units called tokens before Claude ever "reads" them. Tokens are the atomic unit of language for large language models. They're not characters, and they're not always full words. They sit somewhere in between β€” and understanding them unlocks a clearer picture of how AI language models actually work, why they have limits, and how to work with those limits instead of against them. So what exactly is a token? Think of tokenisation as breaking text into the most useful chunks for a model to learn from. Common words like "the" or "and" are usually one token. Longer or rarer words might get split into two or three pieces. Punctuation, spaces, and newlines all count too. Example β€” how this sentence gets tokenised Claude under stands language through tok en isation . As a rough rule of thumb: 100 tokens is about 75 words, or a short paragraph. A typical novel runs around 100,000 words β€” that's roughly 133,000 tokens. Claude's extended context window can hold the equivalent of several books at once. The context window: Claude's working memory Every conversation with Claude happens inside a context window β€” a fixed-size buffer that holds everything Claude can "see" at once. This includes your entire conversation history, any documents you paste in, system instructions, and Claude's own responses. Once the window fills up, older content scrolls out of view. Claude doesn't forget it in the human sense β€” it simply can't read past what fits. This is why very long conversations can occasionally feel like Claude loses track of something said much earlier.

May 20, 20263 min read
What Are Tokens β€” And Why Should You Care?
V

Vishal Mathur - IT Consultant and AI Prompt Engineer

31 posts

With over 9 years of experience as in IT, I have led technology operations across diverse industries, ensuring robust IT infrastructure, network security, and team development.