+ Reply to Thread
Results 1 to 5 of 5

What is wrong with my formula?

  1. #1
    Forum Contributor
    Join Date
    08-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    119

    What is wrong with my formula?

    I am trying to use an index/match formula to pull data from a Query table in my work book, onto another sheet, based on common stock numbers.

    I have tried several things, and none of them seem to be working. First I tried this simple little formula:
    =INDEX(QUERY!A:B,MATCH(A2,A:A,0),2)

    which produced #N/A, so I tried the following:
    =INDEX(QUERY!A:I,MATCH(A2,INDEX(QUERY!A:I,,1),0),MATCH($B$1,INDEX(QUERY!A:I,1,),0))

    with the same results.

    Is there something special about indexing a query that I am unaware of?

    I am attaching an example, but obviously it does not include the query.
    Attached Files Attached Files

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: What is wrong with my formula?

    your query returns the stock# as text so you need to use
    =INDEX(QUERY!$A:$I,MATCH(TEXT($A2,"0"),QUERY!$A:$A,0),MATCH(B$1,QUERY!$1:$1,0))
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    08-06-2012
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    119

    Re: What is wrong with my formula?

    Oh man, thank you so much, this has been driving me crazy. One more question, how would I change that formula to exclude a part of the data it is pulling from the cell. Specifically under the heading DoubleRubs, some of the values are like 10,000 DOUBLE RUBS, or 10,000 DOUBLERUBS, and all I want is the number. I was thinking I could do it with something like a =LEFT(D,-1) formula, but I dont know how to integrate that.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: What is wrong with my formula?

    if you know the number will never be more than 9 digits you might use
    =-LOOKUP(2,-LEFT(INDEX(QUERY!$A:$I,MATCH(TEXT($A2,"0"),QUERY!$A:$A,0),MATCH(H$1,QUERY!$1:$1,0)),{1,2,3,4,5,6,7,8,9}))

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: What is wrong with my formula?

    Hello chaddug, and welcome to the forum.

    Unfortunately you have inadvertently broken one of the forum rules. Please read the following and make the necessary change. Thanks.

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    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.


+ 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