+ Reply to Thread
Results 1 to 13 of 13

Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

  1. #1
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    I am using Index/Match to lookup values in a spreadsheet. There are duplicates that it needs to lookup and decipher which is first and second, so I used a formula to add a 1 or 2 to the original number. I then copy and paste value to remove the formula. Everything works good until I manually change the numbers to reverse them, then Index/Match does not find it. I noticed the number I copy/paste value looks like this for example, "1234", whereas the number I manually enter looks like this, 1234. Of course Excel thinks these are two different numbers, but why the difference when using copy/paste value compared to manually entering the number and how do I make this work if something has to be manually changed for the Index/Match to work?

    Here is a screenshot of what I mean.
    Attachment 403745
    Attached Images Attached Images
    Last edited by thecdnmole; 06-26-2015 at 06:39 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    cant see your pic, but have you tried to make the columns wider?

    edit: OK, I guess it helps to read the whole post, not just teh title, sorry

    As you found, INDEX/MATCH and VLOOKUP only find teh 1st instance of what you are looking for, and then stops looking. By adding a "counter" to the end of the numbers is 1 way of pulling out all duplicates, but by removing the counter, you - removed the counter - which means all duplicates are identical again.

    There are other ways of doing this though, so can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    Last edited by FDibbins; 06-26-2015 at 06:33 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    No, but I don't think that would help. I have attached a sample. Index/Match formula is in A1 on sheet1, chart on sheet2 and lookup value in A1 sheet3.
    Attached Files Attached Files
    Last edited by thecdnmole; 06-26-2015 at 07:41 PM. Reason: forgot to include the formula on sheet 2.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    The problem is that you have 2 different data types.

    The lookup value on Sheet3 is a numeric data type (a number) but the data in the table array is mixed. C1 is a numeric number but C2 is a TEXT STRING even though it LOOKS like a number.

    Notice the cell alignment. C1 (the number) is aligned right but C2 (the text string) is aligned left.

    Also, the formulas in D1:D2 return TEXT stings, not numbers.

    So, how is the table array created? By formulas? Copy/pasted? Imported from another application? Manually entered?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    Thanks Tony for the reply. If I change the format in C1:C2 to number or text, the formula still does not work. I copy the formula in column D on the actual spreadsheet and then copy/paste value back onto itself. The value in column B is manually entered. How do I make the formula in column D return a number? Or, how do I get it all in text or in number? Thanks for the help.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    Simply changing the cell format has no effect unless/until you edit the cell(s) (re-enter the data).

    You can coerce the formulas in D1:D2 to return numbers like this:

    =--(B1&COUNTIF($B$1:$B1,B1))

    However, if any of the numbers have leading zeros then they will be stripped off. If you need leading zeros then you'll have to make the data TEXT. You would also want to make the lookup value text.

  7. #7
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    Thanks again, Tony! I got it to work on my sample, but not on the actual. I then remembered I have yet another formula, which take the original value, such as the number enter on sheet3 and adds a 1 or two to match what's on sheet2. This is the formula I should have put in A1 of sheet3, which then could reference B2 of sheet 3 for the source. "='Facilities(TC331)'!H7&2"

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,550

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    If I am understanding the basic problem, you need to search for a particular instance of a value. I think that can be accomplished by making a change in the way that you look up the values. Notice that I have changed sheet3 from one input cell to two, the first looks up value, the second indicates which instance of that value you want to find. Since it would be hard to know which instance is found I also added a second cell in sheet1 that lets you know whether you are looking at the first (a) or second (b) instance.

    update of Index_Match.xlsx

    Hope this helps.

  9. #9
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    I figured it out! I changed "='Facilities(TC331)'!H7&2" to "=--('Facilities(TC331)'!H7&2)" and now it works 100%! Awesome, thanks again Tony!

  10. #10
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    Thanks JeteMc, looks like your method works as well, but does contain array formula which I would prefer to stay away from or not use if possible. Tony had a fairly simple fix which works, so I am going to use his method. Appreciate the response and suggestion as it might work for someone else's case.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    You're welcome. Thanks for the feedback!

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,550

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    That's why Tony is a Guru. Main thing is that you get a solution that works for you. If your original question has been answered please mark the thread "Solved". Also please add to Tony's and FDibbins' reputations as they made important contributions to the solution.

  13. #13
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Index/Match Excel 2010 formula. Some numbers have "###", others not, ###

    Sorry FDibbins, I did not see that you edited your reply! Thanks for responding so quick and I am curious what other way, maybe easier or better way is there to count duplicates? Thanks to all, have a wonderful weekend!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. Replies: 7
    Last Post: 04-11-2013, 12:46 AM
  4. Strings Variables in Range("A1").Formula = "=index/match" ?
    By nadnerb5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-19-2012, 05:07 PM
  5. [SOLVED] Variable "sheet-name" and "range-name" wanted in INDEX/MATCH-function
    By Fiebuls in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2012, 04:09 PM

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