+ Reply to Thread
Results 1 to 9 of 9

Returning True If Data Is in Range

  1. #1
    Registered User
    Join Date
    07-06-2011
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    63

    Exclamation Returning True If Data Is in Range

    Suppose you have a list A1-A13:
    1
    2
    3
    4
    5
    3
    4
    5
    6

    and you want to see if the Cell C5 is in this list. E.g c5 = 5

    =COUNTIF(A1:A135,C1)>0

    Would work.

    Now what happens if your range is on a different workbook.

    r_t.xlsx (A1)

    being your workbook name

    sheet1 (B1)

    (as it is in sheet one)

    $A$1:$A$10 (C1)
    Being your range.

    ="["&A1&"]"&B1&"!"&C1 (d1)
    being your formula

    =INDIRECT(D1) (e1)

    being your functon to retrive the data.

    Calling my previous =COUNTIF(E1,A3)>0 Using e1, would not compare the whole list; as only one reslt is bein returned by E1.

    PLEASE HELP!!
    Last edited by NBVC; 07-06-2011 at 12:31 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Returning True If Data Is in Range

    What about:

    =COUNTIF(INDIRECT(D1),A3)>0
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-06-2011
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Returning True If Data Is in Range

    Thanks for the effort, but no it doesnt work!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Returning True If Data Is in Range

    On my test it worked perfectly.

    Please note that the source book has to be open.

  5. #5
    Registered User
    Join Date
    07-06-2011
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Returning True If Data Is in Range

    Is my range correct? $A$1:$A$10

  6. #6
    Registered User
    Join Date
    07-06-2011
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Returning True If Data Is in Range

    (and yes my workbook is open)

  7. #7
    Registered User
    Join Date
    07-06-2011
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Returning True If Data Is in Range

    Yes sorry about that; i misread your reply. it works. and its greatly appreciated

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Returning True If Data Is in Range

    It is correct as far as syntax... but your original formula showed A1:A135 as a range.. do you need that coverage or not?

  9. #9
    Registered User
    Join Date
    07-06-2011
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Returning True If Data Is in Range

    thank you, it worked perfectly

+ 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