Consulting

Results 1 to 2 of 2

Thread: How to compare different values either by formula or vba

  1. #1

    How to compare different values either by formula or vba

    Im trying to compare values between two cells, based on the values of other cells.

    The attached workbook explains it better.

    The formula i have in the expected results column works so long as the data is in order, however this isn't always the case, and the formula would have to check that the time is the same for both rows being compared and also find the row containing the next Rank in the sequence.

    I'm not sure if a formula would do this or if it can be done using some vba code that I can integrate into my existing code.

    Thanks

    Book1.xlsx

  2. #2
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    It sounds like you will need a lookup to find your data row, and an offset to find the data to compare.
    as you may need more than one criteria to find your data row, I'd write a function that:

    1 accepts key identifying criteria as inputs
    2 loops through the table until a match is found
    3 returns the value of interest
    Remember: it is the second mouse that gets the cheese.....

Posting Permissions

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