Formula for < or >

serge

Well-known Member
Joined
Oct 8, 2008
Messages
1,446
Office Version
  1. 2007
Platform
  1. Windows
I'm looking for a formula that would separate numbers in 2 columns.

In column A are the numbers that need to be separated.

In C would be the numbers that are inferior of the previous one and in D the one that are superior.

Thank you. Serge.

Excel Workbook
ABCDE
111
21818
366
433
555
61212
71010
82727
93636
104444
112121
1211
1377
141515
15
Sheet1
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I'm looking for a formula that would separate numbers in 2 columns.

In column A are the numbers that need to be separated.

In C would be the numbers that are inferior of the previous one and in D the one that are superior.

Thank you. Serge.

Excel Workbook
ABCDE
111
21818
366
433
555
61212
71010
82727
93636
104444
112121
1211
1377
141515
15
Sheet1
What if the numbers are equal? Is that a possibility?
 
Upvote 0
C1 would be =A1
in C2 put the formula =IF(A1<=A2, A2, "")
and in D2, =IF(A1<=A2, "", A2)

(This puts the = case in column C, if you want that in D, use < in the above)
 
Upvote 0
Yes I forgot to mention it Thank you, It would look like this :

Excel Workbook
ABCDE
111
21818
366
433
533
61212
71010
82727
93636
104444
114444
1211
1377
141515
15
Sheet1
 
Upvote 0
Hi mike,

Thank you for the formula, I forgot to mention that sometime I have numbers that repeat themselves.
 
Upvote 0
This will keep the duplicates in the same column, as indicated in the example

In C2
=IF($A2 < $A1, $A2, IF(AND($A1=$A2,C1<>""),$A2,""))
in D2
=IF($A1 < $A2, $A2, IF(AND($A1=$A2,D1<>""),$A2,""))
 
Last edited:
Upvote 0
Thank you Mike there is just a small problem, the duplicate show up in both column !!!
 
Upvote 0
I just copy and paste the 2 formulas in post # 6, and the duplicate show in both column ?
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,283
Members
452,902
Latest member
Knuddeluff

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