SharePoint calculated column random number [two examples]

In this SharePoint tutorial, I will show you how to generate random numbers using a SharePoint calculated column. I will provide two examples related to “SharePoint calculated column random number“.

I will show two examples here. The first one will generate a two or three-digit random number in a SharePoint list by using a calculated column. And the second will show some random messages using a calculated column in the SharePoint Online list.

Create random numbers using SharePoint calculated column (Digits)

You can follow the below steps to create a random number calculated column in the SharePoint list:

  • Open the SharePoint list, where you need to create a random number.
  • Click on the +Add column -> Choose See all column types -> Then click on the OK button.
SharePoint calculated column random number
  • In Create column page, provide the column name and choose the type as Calculated (calculation based on other columns) as shown below:
SharePoint online calculated column random number
  • Now, provide the formula in the formula box. Based on my requirement, I provided the formula as shown below:
=LEFT(RIGHT(NOW(),3),3)

Where,

  1. LEFT: This function is used to get the 1st letter.
  2. RIGHT: This function is used to get the 1st letter.
  3. NOW(): This function calculates a value based on the date and time. We can easily get the random number different by picking up the time from here.
  4. 3: Passing the argument like how many values should be present in the calculated column.
  • The data type returned from this formula is: Choose the data type, that the result value should be.
  • Then, click on the OK button.
Create a modern SharePoint calculated column random number
  • Now open your SharePoint list, and the calculated column will be added with random numbers.
How to create a SharePoint calculated column random number
  • As per the above image, we can see that all random numbers are similar (For existing items), but if I add another item in the title column, the random number will change because the seconds will be changing based on that it will generate a random number as shown below:
Create a modern SharePoint online calculated column random number

This is how to create a random number calculated column in a SharePoint list.

Create random messages using calculated column in a SharePoint list

With an example, let me explain how to create a random message calculated column in the SharePoint list:

I have a SharePoint list of Employee Onboarding, where the new employees should fill their information in this list. Whenever a user fills details in the SharePoint list, they will receive a random message in the “Motivate” calculated column. Check out the below figure for reference.

Create a SharePoint online calculated column random number

Now we will see how to achieve it:

  • Open the SharePoint list, where you need to create a random message.
  • Click on the +Add column -> Choose See all column types -> Then click on the OK button.
  • In Create column page, provide the column name and choose the type as Calculated (calculation based on other columns) as shown below:
SharePoint calculated column random message
  • Now, provide the formula in the formula box. Based on my requirement, I provided the formula as shown below:
=CHOOSE(LEFT(RIGHT(NOW(),2),1)+1,"I love your confidence","Thank you for your good work","Wow!","Thanks!","You've been a great addition to the team!","Welcome","a free coffee for you!",":-)","I'm excited to work with someone with your experience","You're very creative")

Where,

  1. CHOOSE: This function is used to select any random value from the set of the message where we provided in the function.
  2. LEFT: This function is used to get the 1st letter.
  3. RIGHT: This function is used to get the last letter.
  4. NOW(): This function calculates a value based on the date and time. We can easily get the random number different by picking up the time from here.
  5. The rest all are a list of motivating text arguments.
  • The data type returned from this formula is: Choose the data type, that the result value should be.
  • Then, click on the OK button.
SharePoint online calculated column random message
  • Now open your SharePoint list; the calculated column will be added with random messages.
Modern SharePoint calculated column random message

This is how to create a random message calculated column in the SharePoint Online list.

Conclusion

Using a calculated column, I have shown you how to generate a three-digit random number in a SharePoint list.

Moreover, I have explained how to show some random messages using a calculated column in the SharePoint Online list.

You may also like: