With the assistance of a helper row and with the realization that this is only 4 numbers without a repeat, you could use one of the two following **NOT SO ELEGANT** solutions:

In A1 place the following formula and copy it to the left for 4 columns (end in D1):

```
=RANDBETWEEN(1,4-(COLUMN(A1)-1))
```

Basically it will create a decreasing range of random numbers. It follows the principal that if you have a bag of 4 balls and you pull one out, then the next time you go to pull a ball there is 1 less to choose from so only 3 then 2 then 1 then 0. It does not address the the issue repeats. The other aspect of why this is done is once the volatile results are on the page they will not recalculate until something on the page/sheet changes. This means they are static for other formulas to reference until a recalculation occurs.

The next not so elegant step is to check for repeats. When a repeat occurs you need to add 1. This is a check needs to be repeated after you add 1 in case the new number is also a repeat. So for a small number of integers to deal with it can be done in a couple of ways, but start getting much beyond 5 integers and the formula starts to get unruly.

Since the first digit cannot be a repeat, simply make the formula in A2 point at A1.

```
=A1
```

# OPTION 1 - Checking Duplicates with IF

In B2 place the following formula and copy to the right:

```
=IF(COUNTIF($A$2:A2,B1)=1,IF(COUNTIF($A$2:A2,B1+1)=1,IF(COUNTIF($A$2:A2,B1+2)=1,3,2),1),0)+B1
```

now technically for B2 you only need part of the above formula, but as you copy to the right, or conversely as the number of integers your are dealing with increases, you need to nest an additional IF function. This formula goes the the ultimate case and save you from having essentially a custom formula in each column.

The custom formula pattern would look like the following from A2 to D2:

```
=A1
=B1+IF(COUNTIF($A$2:A2,B1)=1,1,0)
=C1+IF(COUNTIF($A$2:B2,C1)=1,IF(COUNTIF($A$2:B2,C1+1)=1,2,1),0)
=D1+IF(COUNTIF($A$2:C2,D1)=1,IF(COUNTIF($A$2:C2,D1+1)=1,IF(COUNTIF($A$2:C2,D1+2)=1,3,2),1),0)
```

# OPTION 2 - Adding ALL true results

This solution is similar to the above, but it drops the IF and goes straight to the math portion. For demonstration purposes I placed the following equation in the third row. Again start column A by pointing it at A1 to get that initial value, then in B onward start looking at duplicates.

```
=B1+(COUNTIF($A$2:A2,B1)=1)+(COUNTIF($A$2:A2,B1)=1)*(COUNTIF($A$2:A2,B1+1)=1)+(COUNTIF($A$2:A2,B1)=1)*(COUNTIF($A$2:A2,B1+1)=1)*(COUNTIF($A$2:A2,B1+2)=1)
```

Again this is the ultimate case. notice the pattern thought. After each + a new countif is added and it was multiplied by the result of the result before the previous +. So the pattern from A3 to D3 is as follows if you wanted to go with custom formulas:

```
=A1
=B1+(COUNTIF($A$2:A2,B1)=1)
=C1+(COUNTIF($A$2:B2,C1)=1)+(COUNTIF($A$2:B2,C1)=1)*(COUNTIF($A$2:B2,C1+1)=1)
=D1+(COUNTIF($A$2:C2,D1)=1)+(COUNTIF($A$2:C2,D1)=1)*(COUNTIF($A$2:C2,D1+1)=1)+(COUNTIF($A$2:C2,D1)=1)*(COUNTIF($A$2:C2,D1+1)=1)*(COUNTIF($A$2:C2,D1+2)=1)
```

As you can see that formula is going to expand pretty quick as you add more integers. might start getting into number of characters allowed in a formula restriction pretty quick.