Function Problems

How to Replace Slashes with Numbers and Generate Random Numbers in Excel

Camila MilosovichCamila Milosovich Nov 10, 2026 871 views

Question details

The user wants to replace forward slashes and backslashes with specific numbers and automatically generate random numbers for a raffle in Excel.

How to Replace Slashes with Numbers and Generate Random Numbers in Excel
Product
Excel
Device & OS
not provided
Scenario
Cleaning formatted raw data containing slashes and assigning randomized numbers for a raffle or selection process.
Observed behavior
Needs to apply bulk replacements for symbol formatting and output static random numeric values.
Before you start

Ensure you highlight only the specific data range before performing the Find and Replace operation, so you do not accidentally alter dates or formulas elsewhere in the worksheet.

Solution 1Recommended

Use Find & Replace and Random Functions

This method uses the built-in Find & Replace tool to swap slashes for numbers, followed by Excel formulas to generate static random values.

Excel handles bulk text and symbol replacements natively through the Find and Replace dialog. For randomization, the RAND and RANDBETWEEN functions can instantly generate numbers, but their results will recalculate continuously unless locked using Paste Special.

1
Open Find and Replace

Select the required range of cells where the slashes are located. Press the keyboard shortcut Ctrl+H to open the Find and Replace dialog box.

2
Replace the Forward Slash

In the 'Find what' field, type a forward slash (/). In the 'Replace with' field, enter your desired replacement number. Click 'Replace All'.

3
Replace the Backslash

Clear the previous entries. Type a backslash in the 'Find what' field and a different number in the 'Replace with' field. Click 'Replace All' again.

4
Generate Random Raffle Numbers

Click an empty cell and enter the formula =RANDBETWEEN(1,100) to generate a random whole number between 1 and 100. If you need a decimal between 0 and 1, use =RAND() instead. Drag the fill handle to apply the formula to multiple cells.

5
Lock the Random Values

Because random formulas recalculate every time the sheet updates, you must freeze them. Highlight the generated random numbers, press Ctrl+C to copy them, right-click the same selection, and select 'Paste Special' > 'Values' (the icon with 123).

Use Find & Replace and Random Functions
Tip: Using Paste Special > Values effectively deletes the underlying formula, leaving only the permanent random number.
Efficient Data Management with WPS

Easily Replace Characters and Generate Random Numbers in WPS Spreadsheet

WPS Office provides powerful and intuitive data processing tools, including Find & Replace and comprehensive built-in functions like RANDBETWEEN, making bulk data manipulation simple.

  1. 1. Access Find and Replace: Open your workbook in WPS Spreadsheet, select your data, and press Ctrl+H to bring up the Find and Replace dialog.
  2. 2. Execute the Replacement: Input your slash in the 'Find what' box and the replacement number in the 'Replace with' box, then click 'Replace All'.
  3. 3. Apply the Random Formula: Type =RANDBETWEEN(1,100) in an empty cell to generate your random raffle numbers and press Enter.
  4. 4. Paste as Values: Copy the cells containing the random numbers, right-click them, and choose 'Paste as Values' to prevent them from changing when the document is edited.
Easily replace text and symbols with an advanced Find & Replace interfaceFully compatible with Microsoft Excel formulas like RAND and RANDBETWEENConvenient Paste Special shortcuts to quickly lock calculated valuesFree, lightweight, and fast alternative for spreadsheet management
microsoft office alternative - wps office

Frequently Asked Questions

How do I stop random numbers from changing in Excel?

Random numbers generated by RAND or RANDBETWEEN are volatile functions that change upon any recalculation. To stop this, copy the cells containing your random numbers, right-click, and select 'Paste Special' > 'Values'. This replaces the formulas with static text.

What is the difference between RAND and RANDBETWEEN?

The RAND() function generates a random decimal number between 0 and 1, requiring no arguments. The RANDBETWEEN(bottom, top) function generates a random whole integer between the two specific numbers you set in the formula.

Can I limit Find and Replace to a specific column?

Yes. Before pressing Ctrl+H to open the Find and Replace menu, highlight the specific column or range of cells. Excel will only apply the replacement to the selected area.

Will replacing slashes affect date formats in Excel?

Yes, if your dates use slashes (e.g., 01/12/2024), using 'Replace All' on the entire sheet will alter them. To avoid this, select only the specific cells or columns containing the text you want to change before replacing.