+ Reply to Thread
Results 1 to 7 of 7

Finding Value between two Numbers

  1. #1
    Registered User
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2007
    Posts
    25

    Finding Value between two Numbers

    Sheet 1
    a1: 1 b1: 14 c1: House d1: Balloon
    a2: 15 b2: 21 c2: Monkey d2: Banana
    a3: 22 b3: 24 c3: Dog d3: Ball

    Sheet 2
    a1: 1 b1: c1:
    a2: 1 b2: c2:
    a3: 2 b3: c3:
    a4: 6 b4: c4:
    a5:17 b5: c5:
    a6:23 b6: c6:
    a7:24 b7: c7:

    Hi I was wonder if anyone can help me with this...using a Macro...I dont want to use formulas...
    So I want to look at Sheet 2 to Column A...and look for the particular value in sheet 1 and see if that value is between a1 and b1, if not it looks at if its between a2 and b2, and if its not it looks at if the value is between a3 and b3 and so on...until it finds that value...and then it copies the text in column c and d that corresponds to the matched value and pastes in into column b and c in sheet 2.

    So if I want to look at a1 in sheet 2, i find that it is between a1 and b1 in sheet 1...so I will copy c1 and d1 (House, Ballon) and paste it into, b1 and c1 in sheet 2...

    Thank you...

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Finding Value between to Numbers

    I think it would help people if you could put that in a workbook and upload to the forum.

  3. #3
    Registered User
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Finding Value between to Numbers

    Sure! here you go...
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Finding Value between two Numbers

    Try this. Have taken "between" to include boundary values.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Finding Value between two Numbers

    Thank you so much! It works! I was wondering, how would I change the formula if in Sheet 1 the range was in column B and C instead of starting in Column A?

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Finding Value between two Numbers

    There is a simpler approach, which I deliberately overlooked before... Try this formula in B1 and copied down and across. A1:A3 is the range containing the minimum number for each band.

    =LOOKUP($A1,Sheet1!$A$1:$A$3,Sheet1!C$1:C$3)

  7. #7
    Registered User
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2007
    Posts
    25

    (SOLVED) Re: Finding Value between two Numbers

    Thanks it works!

+ 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