+ Reply to Thread
Results 1 to 5 of 5

My logic is is illogical, apparently.

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Cubeville
    MS-Off Ver
    Excel 2010
    Posts
    3

    Question My logic is is illogical, apparently.

    Okay, so I have a formula that is meant to go to the fist instance of contiguous text value in column K, take the corresponding date from column L, and subtract that from the final corresponding date from column M, then display that ammount in column O. All other values for column O, with identical contiguous values for column K should be "0". The idea is to give a number of days from the first date for a person, to the last date listed. For some reason, the result of the formula in O16 (regardless of what order I apply the logic) continues to be the same as if the formula reads =M16-L15. The way I wrote and read this formula, the logic looks sound to me, but it just is working the way I think it should.

    In any case, here is the formula for O16
    =M16-(IF(K16=K17,M16,(IF(K16=K15=K14=K13=K12=K11,L11,(IF(AND(NOT(K16=K11),K16=K15=K14=K13=K12),L12,(IF(AND(NOT(K16=K12=K11),K16=K15=K14=K13),L13,(IF(AND(NOT(K16=K13=K12=K11),K16=K15=K14),L14,(IF(AND(NOT(K16=K14=K13=K12=K11),K16=K15),L15,L16))))))))))))

    Here is what is looks like:
    Capture.PNG

    Can anyone tell me why this isn't working? Making it work will save me 64,000 lines of review. Seriously. Thank You.

  2. #2
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: My logic is is illogical, apparently.

    Noso,

    First off, in your IF statements, your conditions cannot be K16=K15=K14=K13=K12=K11, you can only have one equal sign at a time... you can do something like... AND(K16=K15,K16=K14,K16=K13, etc.)

    Secondly, if I understand you... for O16, it should equal M16-L14... correct?

  3. #3
    Registered User
    Join Date
    06-18-2013
    Location
    Cubeville
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: My logic is is illogical, apparently.

    Yes, thanks, that's the goal. I'm trying to find overall period for travel by individuals, from the first day.

    The IF statement conditions were a little confusing, as when I did a test to see if the mutiple ='s would work, I did this: Capture2.PNG, which seems to work. Is this something that happens when you nestle logic?

    Thanks!

  4. #4
    Registered User
    Join Date
    06-18-2013
    Location
    Cubeville
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: My logic is is illogical, apparently.

    Excellent. You've fixed the issue, it seems. THANKS!!!

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: My logic is is illogical, apparently.

    NoSo,

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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