# Need Formula

#### CARBOB

##### Well-known Member
Need a formula in column X, if the value in W23 is smaller than W22, return a "D", if larger, return a "U", if the same return a "R".
Excel Workbook
WX
231D
249U
258U
261D
DIGIT REPEATS
Excel 2007

### Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

#### a massive zebra

##### Board Regular
=LOOKUP(w23-w22,{-999,0,0,999},{"D","R","U"})

Last edited:

#### Andrew Poulsom

##### MrExcel MVP
What did you try, and why is X25 U when W25 is less than W24?

#### CARBOB

##### Well-known Member
=LOOKUP(w23-w22,{-999,0,0,999},{"D","R","U"})

The "R" doesn't work. Mr Poulsom, the values are running from bottom to top.
Excel Workbook
WX
231D
249U
258U
261U
271U
DIGIT REPEATS
Excel 2007
Cell Formulas
RangeFormula
X23=LOOKUP(W23-W24,{-999,0,0,999},{"D","R","U"})
X24=LOOKUP(W24-W25,{-999,0,0,999},{"D","R","U"})
X25=LOOKUP(W25-W26,{-999,0,0,999},{"D","R","U"})
X26=LOOKUP(W26-W27,{-999,0,0,999},{"D","R","U"})
X27=LOOKUP(W27-W28,{-999,0,0,999},{"D","R","U"})

#### Andrew Poulsom

##### MrExcel MVP
Mr Poulsom, the values are running from bottom to top.

You said:

if the value in W23 is smaller than W22, return a "D"

#### CARBOB

##### Well-known Member
My mistake, should have been, W23 less than W24.

#### CARBOB

##### Well-known Member
Looking for a formula in column O, if the value in column N increases, return a "U", Up. If the value decreases, return a "D", Down. If the value is the same, return a "R", Repeat.
Excel Workbook
MNO
509/08/146U
609/07/143D
709/06/149R
809/05/149
SKIPSUMS
Excel 2007

Last edited:

#### Andrew Poulsom

##### MrExcel MVP
In O5 copied down:

=IF(N5=N6,"R",IF(N5>N6,"U","D"))

#### CARBOB

##### Well-known Member
Very nice, Mr Poulson. Many thanks.

Replies
2
Views
149
Replies
12
Views
781
Replies
5
Views
372
Replies
2
Views
215
Replies
6
Views
340

1,191,031
Messages
5,984,235
Members
439,879
Latest member
KingGoulash

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