"If text then give random number" query

tomh4

New Member
Joined
Mar 19, 2016
Messages
2
Hi. I think I'm nearly there on the IF function but not quite. I want a function that says if a given cell contains a certain text phrase, then choose a random number between x and y, and if it doesn't then choose from a different range. Does that make sense and is it possible?

Thanks,

Tom
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Do you mean something like this in say B2...

=IF(A2="This Text",RANDBETWEEN(1,5),RANDBETWEEN(6,10))

Hope that helps.
 
Upvote 0
Perfect Snakehips thanks. I was putting "" around the RANDBETWEEN functions. I knew I was close!

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top