# Rand with decimals (positive value + negative value)

#### ankitanks

##### New Member
Hi guys,

I am tryin really hard to find a solution to this but no luck so far. I need two sets of random values.

1. Between 1 & 4. With one decimal
2. Between -17 & -20. With one decimal

Thank you heaps.

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi & welcome to MrExcel

What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

It is Microsoft 365.

+Fluff 1.xlsm
A
1
22.5
3-19.4
Main
Cell Formulas
RangeFormula
A2A2=RANDBETWEEN(10,40)/10
A3A3=RANDBETWEEN(-200,-170)/10

And format the cell for 1 decimal

Thank you. That worked like a treat. Can you please explain the logic behind (10,40) & (-200, -170).

By using 10 & 40 & then dividing by 10 you get a number between 1 & 4 with one decimal place.

Replies
4
Views
541
Replies
2
Views
161
Replies
6
Views
346
Replies
14
Views
449
Replies
5
Views
392

1,203,060
Messages
6,053,303
Members
444,650
Latest member
bookendinSA

### 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.

### Which adblocker are you using?

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

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