+ Reply to Thread
Results 1 to 2 of 2

If condition problem

  1. #1
    Registered User
    Join Date
    02-22-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    If condition problem

    Hi all, I am building a code that does a similar job like MATCH INDEX or Vlookup.
    but these functions need their inputs to be in an certain order if i want a APPROX match.
    so I built my own code.
    I worked for a while and now it doesn't anymore...

    here is my condition that gives me headache
    Please Login or Register  to view this content.
    I am debugging it, so there might be some wierd stuff and stuff that are commented. but the real headache part is here:

    Please Login or Register  to view this content.
    first and second statement works fine, at the third, it doesn't here is sample result:

    622 621
    622 622
    165 622
    165 165
    165 165
    168 165
    170 168

    (these are j value, for loop iteration, or row number)

    Some BG story.
    Its a code to approximate a Milepost depending on the GPS location. the mile post has been approximated depeding on the distance different points has. but the data acquisition is every 10 seconds. so there are holes and we want a more "accurate" approx. so I built something that gets the two closest points (over and under the searching value). after i simply extrapolate the value and search it via the wanted value. the prob is j is not comparing properly..

    thank you all!

  2. #2
    Registered User
    Join Date
    02-22-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: If condition problem

    Well I think I sort of solved the problem by adding a new variable instead of rowafter and rowbefore.

    But I still have a problem with the comparison with the doubles.
    I tried to round them to 10 decimals, but it seems like it doesn't work.
    any help?

    here is the updated code :
    Please Login or Register  to view this content.

+ 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