+ Reply to Thread
Results 1 to 20 of 20

Looking to check back three or possibly four cells in a column till it finds the larger

  1. #1
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Looking to check back three or possibly four cells in a column till it finds the larger

    This is the formula I'm currently using.

    =IF(B31="?","",IF(OR(B31>B32,AND(B31=B32,B31>!B33)),1,""))

    What I'm needing to do is if B31 is equal to B33, I need it to check back one more cell in B34 then do it's calculating.

    I've tried to rewrite it with both the AND/OR functions, but can't get it to work. What am I doing wrong with it?


    Thanks a ton guys and sorry to bug ya'll again.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Not sure if this your problem, but try removing the ! in front of B33

    =IF(B31="?","",IF(OR(B31>B32,AND(B31=B32,B31>!B33)),1,""))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Thanks FDibbins. Yeah, I see that now. This is a toned down version of the formula. I just didn't get the ! took out when putting it on here. It was a copy and paste error on my part.
    That part works. I need it to check if B31 is greater than B32, if B31 is equal to B32, then I need it to check B31 against B33 to see if it is greater than it. That works right, but if something happens that B31 is also equal to B33, then I need it to check B34 to see if it is greater than it. I don't think there would be any reason to make it any longer to check B35 also, because I have not needed it to so far and I've been doing this a while now. (As in what I'm looking at, not the formula writing). Still light years behind you guys.




    Quote Originally Posted by FDibbins View Post
    Not sure if this your problem, but try removing the ! in front of B33

    =IF(B31="?","",IF(OR(B31>B32,AND(B31=B32,B31>!B33)),1,""))

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Hard to say without seeing some dummy data, but have you considered looking at using max() with match() to find the row number?

    or something like a series of nested if()'s?

    =if(B31>=B34,"what_you_want_here1",if(B31>=B33,"what_you_want_here2",if(B31>=B32,"what_you_want_here3","what_you_want_here4")))

  5. #5
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Quote Originally Posted by FDibbins View Post
    Hard to say without seeing some dummy data, but have you considered looking at using max() with match() to find the row number?

    or something like a series of nested if()'s?

    =if(B31>=B34,"what_you_want_here1",if(B31>=B33,"what_you_want_here2",if(B31>=B32,"what_you_want_here3","what_you_want_here4")))
    That would be great if I had any idea of how to do that. I don't . LOL. I'm still learning even the smaller stuff like the AND and OR.
    I'm trying some nested IF's but can't get it right. I can't use the >= together to make it do the way I need it to.

    What I'm needing is if B31 is greater than B32, then my if true statement, but if B31 is equal to B32 then I need to check B31 against B33. If B31 is equal to B33, then it would need to check B31 to see if it is greater than B34.

    That's what I'm looking to do anyway.

    I may have to do some column hiding to get it the way I want it, and that's ok to. As long as it works, is all I need anyway.

    Thanks for the help FDibbins!!! Again.

  6. #6
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    And if B31<B32 ?....I think its time you uploaded a sample workbook showing examples of what you have, what you expect, and some explanations of WHY the answer is correct...see my signature (below) for uploading details
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  7. #7
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Here is a sample of what I'm up against.

    I've set it up to show how I had it working with the formula also to give an idea.

    I think I got it to where you can all see what I'm needing.

    I will have the same formula with the > switched to < for if it's less than. If I can get one working, I can change all that to how I need it. All my nested If's are just doing nothing.

    Thank you again!!!
    Attached Files Attached Files

  8. #8
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Okay, B7= B8 , C7 shows B7?...I am sorry if I am sounding dense here...it is your upload is not showing 1's anywhere...what would you expect where ?

  9. #9
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    [QUOTE=dredwolf;3191272]Okay, B7= B8 , C7 shows B7?...I am sorry if I am sounding dense here...it is your upload is not showing 1's anywhere...what would you expect where ?[/QUOTE

    Your not. It's the way I put it on there I guess. The formula is in F15 that I'm using. I've put it on there to show how it works. It starts with that 7 in B7 then tests that 7 against the 7 in B6. Because they are the same, it then checks the 7 in B7 against the 5 in B9. Since that 7 is greater than the 5, it gave me the 1 result I'm looking for.

    What I'm needing is the same thing but if it comes up like in D where there are the same digits back to back to back, for it to check back and compare that 7 in D7 till it gets to the 5 in D11.

  10. #10
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    And return what?... i can array formula or sumproduct a formula or some other formula, but WHAT? is supposed to show up WHERE?..I do get what you are trying to do, I just do not have any idea of how you expect the results to look like

  11. #11
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    I just need if it is greater than to show a 1 in the cell the formula is in is all. I have another set of formulas that pick up that 1 and does it's thing. It doesn't really matter what cell the formula goes in. If there is an easier place for you to put it, that's ok with me.

    I appreciate it, and sorry for the confusion.

  12. #12
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    What I am trying to get at, is I can look at every cell below and find the first one that is less, that is pretty simple, but, if I am hearing you right..You want the cell next to the cell that is less the current cell to have a 1 in it? This could get pretty complex, THAT is why I was asking for a sample with a few EXPECTED answers, so I could see a pattern to follow...sorry if I made this more complex than it had to be, it just seemed obvious to me

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    did you try jis 1?

    =if(B31>=B34,1,if(B31>=B33,1,if(B31>=B32,1,1)))

  14. #14
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Quote Originally Posted by FDibbins View Post
    did you try jis 1?

    =if(B31>=B34,1,if(B31>=B33,1,if(B31>=B32,1,1)))
    Hello again Fdibbins,

    Yeah, but because of the = to involved in the formula it returns the value. I'm looking for greater than only and that returns if it's equal to also. I'm needing it to only check elsewhere if it is equal to the previous. If that makes sense.

    I may have to do some hidden cells with it, but that's ok. As long as it works is all that matters.

  15. #15
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Obviously, me and you are not communicating, so, I'll follow this thread, but I will not post any more replies, I'm interested in seeing what finally works for you, just not interested enough to spend anymore time on it, sorry

    Edit-
    ANY English Teacher's out there that want to correct that to 'you and I', feel free, it's a large world after all
    Last edited by dredwolf; 04-10-2013 at 12:38 AM.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    so remove the =. I used this on your sample data and it seems to work...
    =IF(B7>B8,1,IF(B7>B9,1,IF(B7>10,1,IF(B7>B11,1,""))))

    You can extend that as far as you want

  17. #17
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Quote Originally Posted by dredwolf View Post
    Obviously, me and you are not communicating, so, I'll follow this thread, but I will not post any more replies, I'm interested in seeing what finally works for you, just not interested enough to spend anymore time on it, sorry
    LOL. I don't blame you. I can't explain what I'm thinking worth a dime. I'll just do some hidden cell type of thing and go from there. It'll take a little longer, but that's ok.

    I'll set up one to check say B7 against B8 and if it's even, it will give a blank cell. Then another column with if B7 is greater than B9 and if it's the same digit it will stay blank. And so on. Then I'll fix the other part where this was supposed to go, to pick up the data from there. It's no big deal. I've just gotten to greedy with how great this stuff works is all. A little extra work is no problem at all.

    I really appreciate you looking at it for me and your time!!!!

  18. #18
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Quote Originally Posted by FDibbins View Post
    so remove the =. I used this on your sample data and it seems to work...
    =IF(B7>B8,1,IF(B7>B9,1,IF(B7>10,1,IF(B7>B11,1,""))))

    You can extend that as far as you want

    It's still giving a value when it shouldn't.

    It's ok. I can go the hidden cells direction. It's no problem at all.

    I've put enough time into this "thing" I'm working on, a little more won't hurt me.

    Thank you both very much for your time!!!!!!

    I can use the old formula I was in a couple of columns and just change it up a little, then hide them. Won't take long a' tall.

  19. #19
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Ok, let's see if this one shows what I'm needing.

    If it doesn't, then ya'll don't even worry about it.
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: Looking to check back three or possibly four cells in a column till it finds the large

    Ok. In case anyone else runs into this problem here is what I cam up with for this. Since I couldn't figure out how to explain what I was needing to do before, and now that I have it fixed, I can explain it. (Brains forget to work in my head sometimes). But, say that B3 is 7, B4 is 7, B5 is 7 and B6 is 5. In C3 I would have needed to find out if B3 is greater than B4. Since B4 is equal to, I would have to check B3 against B5 to see if it was greater than it. Here again, it was equal to. So I needed to check B3 against B5. Again, the same thing. So I would have to go back to B6 and check B3 against it. Here B3 was not equal to B7 and it was greater than. That's the answer I was looking for. So I had to put it in a nested IF(AND situation that if B3 was = to B4, to check B3 against B5. Then the next go around, I had to include if B3 was equal to B4 and B5 then greater than B6. I had equal to each preceding cell to the equal to checking before doing the next greater than check. So here is the formula. It took me about ten thousand tries, but I'd rather do that than have you all set and try to guess what I need taking up your time. Again, I honestly do appreciate all the help any and all you people have given me. Even the offering to look at my problems. Your all invaluable and have taught me what I know about this stuff. Thank you all!!!!

    =IF(B1>B2,1,IF(AND(B1=B2,B1>B3),1,IF(AND(B1=B2,B1=B3,B1>B4),1,IF(AND(B1=B2,B1=B3,B1=B4,B1>B5),1,"")))))

    This one was a little longer because it's working from one sheet to another, but it works the way I needed it to.

    Thanks again all of you!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1