greenfortyguy

New Member
Joined
Sep 7, 2017
Messages
13
Hello,

I am trying to write a formula that will perform the following function, and drag down a column:


  • IF the value in column K is <0, the value in the same row of column I is the equivalent positive.
  • The values in column I remain as a maximum.

This is an example of the result I'm looking for:


IJK
025,0344,966
024,9915,009
024,9465,054
024,8735,127
024,8205,180
368230,000-3,682
368233,628-3,628
368233,56167
368233,495133
368229,759187
368229,700246

<colgroup><col span="2" style="text-align: center;"><col style="text-align: center;"></colgroup><tbody>
</tbody>

Thanks,

Guy
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Not sure what this means:
  • The values in column I remain as a maximum.
Where are the zeroes in the other rows coming from?

If you just want it to either be the opposite of column K if column K is negative, and 0 otherwise, then try this in cell I2:
Code:
=IF(K2<0,0-K2,0)
 
Last edited:
Upvote 0
Hi Joe,

What I meant was, if a value appears in column I as a result of the value in column K being negative, that value remains in all the cells below even if the values in column K are positive.

i.e. in my example,
  • the first negative value in column K is -3,682. As a result, +3,682 appears in column I.
  • the next value in column K is -3,628. However, -3,682 remains the value in column I.
  • the next value in column K is +67. -3,682 remains in column I.

This would continue, unless a more negative value than -3,682 appeared in column K. If this were to happen, that value would then be repeated.

Thanks,

Guy

EDIT: The zeros are coming as the result of a potential use of the formula =IF(K2<0, -K2, 0), which is essentially the formula you stated.
 
Last edited:
Upvote 0
Assuming that your data starts on row 2, enter this in I2 and copy down for all rows:
Code:
=0-MIN(0,$K$2:K2)
 
Upvote 0

Forum statistics

Threads
1,215,494
Messages
6,125,139
Members
449,207
Latest member
VictorSiwiide

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