• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

VLOOKUP for cells that do not match exactly|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / VLOOKUP for cells that do not match exactly|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…VLOOKUP for cells that do not match…
sp_PrintTopic sp_TopicIcon
VLOOKUP for cells that do not match exactly
Avatar
charles leaton

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
1
June 7, 2019 - 12:52 am
sp_Permalink sp_Print

Hello,

I may be using the wrong function but I believe VLOOKUP is what I need. Here is my problem. I have a large amount of data with different attributes in each of the two sets of data. For instance

one set has (document#, date, time, road name) the other has (date, time, road name, + many more)

The goal is to match the document# to the data that includes all the extra attributes

The problem is that the time may be off by a couple minutes and not an exact match and the road name may be (Arthur DR.) in one cell and in the matching cell (Arthur DRIVE). I have been able to easily match the documents manually but as there are hundreds of these documents I am trying to find a quicker way to match them up. The cells are also not perfectly lined up as there are only 100 documents to match and maybe 1000 that I am searching for the match in.

I do not know if this is all the information needed to make the problem clear but I need help please!

Let me know if more information is needed

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
2
June 7, 2019 - 6:01 am
sp_Permalink sp_Print

Hello,

It is always easier if we can see the data, a small sample file is good enough.

Avatar
charles leaton

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
3
June 7, 2019 - 10:33 pm
sp_Permalink sp_Print

Hi,

Here is a sample. I have highlighted the matching data. I am trying to connect the data on the left to the data on the right.

Avatar
Frans Visser
Duivendrecht (near Amsterdam) - The Netherlands

VIP
Members
Level 2
Forum Posts: 346
Member Since:
April 21, 2015
sp_UserOfflineSmall Offline
4
June 8, 2019 - 9:26 pm
sp_Permalink sp_Print

Well the number is the matching point for the Vlookup, but I can't follow you in what comes from one source and what from the other and what you want to combine. I think the columns C:I in your example are the ones descriped as 'document#' and the columns M:S the ones with the more data.

What do you want as output from these two? And what to do with the rows that belong to a certain number, but where in the column M the number is not repeated?

Frans

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 870
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
5
June 9, 2019 - 12:51 am
sp_Permalink sp_Print

Hello,

As you probably already know, by having lookups without using exact match you will end up with incorrect results, sooner or later. In order to trust the data you need to know it is showing correct values, else a message or error of some kind.

With this said, I find it difficult to find a good solution based on your data. If we could have a unique value on which we could combine the two data sets this would be a whole different issue.

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
6
June 9, 2019 - 1:38 am
sp_Permalink sp_Print

Hi Charles,

Only a visual basic based solution can help, or Power Query.

Attached is a power query solution, the query I used is:

let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Number", Int64.Type}, {"DateTime", type datetime}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Match", (x)=> Table.FirstN(Table.SelectRows(Table2, each [#"Date/time"] >= x[DateTime]),1)),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Match", {"Date", "Date/time", "Street Address", "City Name", "State Name", "Postal Code"}, {"Match.Date", "Match.Date/time", "Match.Street Address", "Match.City Name", "Match.State Name", "Match.Postal Code"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Custom",{{"Match.Date", type date}, {"Match.Date/time", type datetime}})
in
#"Changed Type1"

The logic behind the query is:

Select from Table2 all rows with DateTime greater or equal to Table1 -DateTime, and keep just the first row.

Avatar
charles leaton

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
7
June 11, 2019 - 12:45 am
sp_Permalink sp_Print

Thank you, I will be trying this and will get back to you. I really appreciate it.

 

Charles

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Jessica Stewart, Mark Carlson, Calvin Richardson
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
yashal minahil
Oluwadamilola Ogun
Yannik H
dectator mang
Francis Drouillard
Orlando Inocente
Jovitha Clemence
Maloxat Axmatovna
Ricardo Freitas
Marko Meglic
Forum Stats:
Groups: 3
Forums: 24
Topics: 6201
Posts: 27185

 

Member Stats:
Guest Posters: 49
Members: 31861
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.