Up down formula

xeven_

Active Member
Joined
Jan 20, 2012
Messages
302
Is there a formula I can put in C2 that will give the value of positive one when the prior day/cell in column B is higher and negative one when the when lower than the previous day?

7/6/2019
1
7/7/2019
2
1
7/8/2019
3
1
7/9/2019
2
-1
7/10/2019
1
-1
7/11/2019
0
-1
7/12/2019
5
1
7/13/2019
6
1
7/14/2019
7
1
7/15/2019
8
1

<tbody>
</tbody>
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You did not say what should happen if the two cells being compared are equal, so the formula below assumes that cannot happen...

=IF(B2>B1,1,-1)
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,180
Members
448,871
Latest member
hengshankouniuniu

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