array iteration problem

r1998

Board Regular
Joined
Sep 9, 2018
Messages
106
Dear friends and respected seniors,
I have the following data in column A, starting from A2
100
200
250
300
100
350
550
400

What I am trying to do is I compare A2 with A3 . If A3<=A2+100 , then compare A2 with A4 and so on......
If A3>=A2+100 , use that cell instead of A2 and compare with the lower cells.....means compare A3 and A4 and so on
i have used this formula in column B
Code:
= IF( A3>=A2+100,A3,"")
and this in column c
Code:
= IF( A3>=$A$2+100,A3,"")
but i am getting incorrect results. :(
this is the link of screenshot of my excel sheet
http://tinypic.com/r/24o0j6a/9
9

I have manually entered the required results in column D.
9

Can anyone please kindly guide me as to how I can achieve the results of column D.
Awaiting your replies.
Thank you. :)
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
This is what I want in column D, just in case someone doesnt view the screenshot :)
d2=" "
d3=200
d4=" "
d5=300
d6=" "
d7=" "
d8=550
d9=" "

Thank you :)
 
Upvote 0
What is the reasoning behind 300 in D5, that is, how does that obtain? Please use words, not Excel formulas in your explanation.
 
Upvote 0
comparing A3 and A4, then A3 and A5, A5 is more than or equal to A3 plus 100, hence d5 will have value of A5 :)
 
Upvote 0
Welcome to the MrExcel board!

In D3, copied down.

Excel Workbook
ABCD
1
2100
3200200
4250
5300300
6100
7350
8550550
9400
Sheet5
 
Upvote 0
Thank you Aladin Akyurek for replying :) and thank you Peter_SSs for welcoming :) and for the perfect answer :) it worked perfectly :beerchug: Thanks
 
Upvote 0
Hello again :biggrin:
I have installed excel 2003 and excel 2010, but I am learning from this book "John Walkenbach-Excel 2003 Formulas-For Dummies (2003)" hence mostly I use excel 2003.
This formula worked perfectly in excel 2010, but its giving error in excel 2003 because of the IFERROR function :(
Code:
[COLOR=#000000][FONT=Arial]=IF(A3>=IFERROR[/FONT][/COLOR][COLOR=#000000][FONT=Arial](LOOKUP[COLOR=#0000FF](9.99E+307,D$2:D2,A$2:A2)[/COLOR],A$2)[/FONT][/COLOR][COLOR=#000000][FONT=Arial]+100,A3,"")[/FONT][/COLOR]
How can I get this formula to work in excel 2003 too :smile:
Awaiting your replies.
Thanks.

 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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