+ Reply to Thread
Results 1 to 19 of 19

Value match (but not exact) like ctrl+F

  1. #1
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Value match (but not exact) like ctrl+F

    I've made a little example spreadsheet, it is attached.

    I want to input reference number and pull the data off other sheets, if that number is found there.
    But it only finds the values if the reference number is exactly the same.
    With every reference number there actually come initials, from the person dispatching the box/pallet.
    So in UPS sheets they would look like: 5628052MZ, 5630001KD...

    I do not know who dispatched the box so Ive only got the numbers.
    In that case values are not returned.

    What shall I do to overcome this ?

    >>EDIT: Ah yes I forgot about something. I have a carrier field. What I need:
    If any value is found in any sheet, return the name of the sheet where value has been found to the carrier field.
    So if I typed in the reference number and formula would find a date for it in "UPS" sheet, the carrier cell for that row would now say "UPS".
    Is it possible?


    >>EDIT2:
    I've come up for this with the carrier field so far:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    But only returns value for UPS, doesnt go further. I know this is very crappy scripting of mine, so please help .


    Many thanks,
    Matt.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,969

    Re: Value match (but not exact) like ctrl+F

    As you may have noticed.... nothing was attached.


    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: Value match (but not exact) like ctrl+F

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Value match (but not exact) like ctrl+F

    Try:

    =IF(COUNTIF(ups!$A:A,main!$A3), "UPS", IF(COUNTIF(TFS!$A:A,main!$A3), "TFS",
    IF(COUNTIF(OT!$A:A,main!$A3), "OT", IF(COUNTIF(polarspeed!$A:A,main!$A3), "POLARSPEED",""))))

  5. #5
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    Second try with attachment

    >>EDIT: Thanks Phuocam this worked! Any ideas about finding matching parts of the value ?

    cheers
    Attached Files Attached Files
    Last edited by kesh123; 02-25-2018 at 11:53 AM.

  6. #6
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    I've read about COUNTIF and it gave me an idea. Would it be possible to include COUNTIF into the formula to block it from finding values for the reference that is already there, in the main sheet?
    What I mean is: You type in the reference, you get your values for it, later on you are mistaken and input the same reference number, but values show "Duplicate" or something now.
    What do You guys think ?

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,969

    Re: Value match (but not exact) like ctrl+F

    Do you mean this:

    I do not know who dispatched the box so Ive only got the numbers.

    If you DO mean that, then why is Main A22 5628111MA.. If the MA is a mistake, then try this in M2, copied down:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You will need to use a named range in the UPS sheet to auto-set the range. Before explaining that, let's get the other bits sorted first. Shading done manually for illustration....
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    Yeah, I do not know initials, I put them there only for testing.
    Thanks for that, I've got carried field almost solved.

    So we would like to include your bit of code into this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I've tried to but I've failed. help

    I would like to specify that I do not know the size of UPS, TFS .. sheets.
    Or is it what You are about to explain? With the named range...
    Please.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,969

    Re: Value match (but not exact) like ctrl+F

    You'll have to explain what you mean by "include my bit of code into this".

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,969

    Re: Value match (but not exact) like ctrl+F

    The issue of data size is relevant ONLY for UPS. The formula for the others is happy to deal with whole column references. This is an array formula and will ignore balnks in UPS. I set it to look for 1000 rows. how many will you REALLY need? there are possible alternatives...

    Still need an answer to my earler Q.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

  11. #11
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Include INDEX and MATCH with this bit:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    So it finds data by part of the value, tells me if its a duplicate

  12. #12
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    Yeah this works for my carrier field as the value returned is value specified by me, because I know that it will say "UPS" if the data is found in UPS sheet.
    What if to get my value I need my INDEX and MATCH, but I don't know how to put it together.
    So it would do INDEX + MATCH but only if the reference is found (exact or part of it) and it tells me it is duplicate if I input it twice.

    Since I could not put your piece of script together with my INDEX + MATCH, I've tried to come up with something on my own.
    This gets my values, having 2 sheets "UPS" and "POLARSPEED".
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It finds the part of value and tells me about duplicated just fine BUT one problem.
    No value returned if the match is exact.

    Sometimes people forget to include their initials in the reference number and the match would be exact.
    So how to make it find the match exact OR partial? Tried to mess around with OR funtion but failed as well.
    Or how to put together INDEX and MATCH with SUMPRODUCT and LEFT and make it work ??

    Sorry but I am begginner please be patient with me :p

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,969

    Re: Value match (but not exact) like ctrl+F

    Sorry. I do not follow what you are trying to do.

    1. How does the formula that I suggested NOT do what you want?

    2. To explain where you want to go next, please attach a fresh sheet explaining your requirement.

  14. #14
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    It does what I wanted. But only for carrier field where I do not need to use INDEX / MATCH.
    I need to use INDEX/MATCH for other columns. I do not know how to do that.
    How to use INDEX/MATCH so it finds exact match OR part match and tells me about duplicates.
    This is what I need to do.

    I got almost there on my own since I couldn't figure out how to base my code (with INDEX/MATCH) on yours, the one solving matching and duplicate issue.
    That formula is in main sheet table column B. If You could help me own and do it your way with columns C and D , that would be brill.

    Thanks
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    Any thoughts?
    Thanks

    BUMP

    Bump 2
    Last edited by kesh123; 03-01-2018 at 11:43 AM. Reason: BUMP

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,969

    Re: Value match (but not exact) like ctrl+F

    Apols. Missed your reply.

    In B2, copied across and down, an array formula:

    =IF($E2="","",IF($E2="Duplicate","Duplicate",VLOOKUP($A2,LEFT(INDIRECT("'"&$E2&"'!A1:D500"),7)+0,COLUMNS($A:B),FALSE)))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

    Change A1:D500 to be compatible with the size of your data, but DO NOT use whole column references.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 02-27-2018 at 09:27 AM.

  17. #17
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    Hey Glenn,

    Thanks for help. This looks like this is going to work just fine.

    And the formula is so neat and simple, much better than what I tried to achieve.
    So no need for index/match to do what I wanted after all )

    Thank You so much, this problem is solved.

    I may need some help with conditional formatting but If I will, I am going to create a new topic for that.

    Thanks again mate!
    Last edited by kesh123; 03-01-2018 at 12:30 PM.

  18. #18
    Registered User
    Join Date
    02-23-2018
    Location
    Doncaster, England
    MS-Off Ver
    2010
    Posts
    34

    Re: Value match (but not exact) like ctrl+F

    Okay it is not going to work for me, because I do not understand it.

    In my proper spreatsheets Ive got these values in different places.
    So how should the formula know where to look for the data? (ups, polarspeed... sheets)
    Also what does E2 represent in there? There is a carrier field in E2.
    I've changed the formula with my new spreadsheet accordingly but doesnt work.

    im noob

  19. #19
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,969

    Re: Value match (but not exact) like ctrl+F

    =IF($E2="","",IF($E2="Duplicate","Duplicate",VLOOKUP($A2,LEFT(INDIRECT("'"&$E2&"'!A1:D500"),7)+0,COLUMNS($A:B),FALSE)))

    Red: The formula says, if E2 is blank return a blank, if E2 is "duplicate", return "duplicate" otherwise follow the formula.

    Gold: Since the value in E2 is the name of a carrier, and also the name of the sheet where that carrier's data are kept, I used INDIRECT to pick up the sheet name from E2 and do a lookup to return the date, based on the invoice number (green). The formula looks for a match between the 7 digit invoice number in column A and the first 7 characters of the invoice number (cyan)

    Since I have not seen your proper sheet, I have no idea where things are, or what you have done. I need to see your real sheet... or you need to really carefully check over a) if you asked the correct question, b) if your example was truly representative, or c) how you mis-transcribed the formula that I gave you.

+ 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. Validating 2 cells goes wrong, finds first match instead of exact match.
    By EricNL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2015, 08:38 AM
  2. To Sort exact and partial exact match for a single column.
    By Jagdev in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2014, 05:08 AM
  3. Disable cut,copy,paste(including ctrl x, ctrl c n ctrl v)
    By Ramboexcel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2014, 01:00 AM
  4. [SOLVED] sumif which finds text, not an exact match, but a close match instead
    By Beefy1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-19-2014, 08:29 PM
  5. Replies: 3
    Last Post: 06-17-2013, 12:37 PM
  6. [SOLVED] Index & Match returning incorrect value. Arrays fixed and exact match used.
    By SDes in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-07-2012, 08:29 PM
  7. Replies: 2
    Last Post: 01-28-2012, 05:26 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