{"id":16209,"date":"2023-08-24T16:48:02","date_gmt":"2023-08-24T16:48:02","guid":{"rendered":"https:\/\/officetuts.net\/excel\/?p=16209"},"modified":"2024-02-19T14:52:06","modified_gmt":"2024-02-19T14:52:06","slug":"excel-vlookup-and-mid-for-data-analysis","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/","title":{"rendered":"Excel VLOOKUP and MID for Data Analysis"},"content":{"rendered":"\n
Excel-VLOOKUP-and-MID-for-Data-Analysis<\/a>Download File<\/a><\/div>\n\n\n\n

Excel formulas are made in a way that complicated things can seem easy. There is always an option to combine the formulas to extract the data and to get valuable information from our data set.<\/p>\n\n\n\n

In the example below, we will show how to combine VLOOKUP and MID formulas<\/strong> to get the results we want.<\/p>\n\n\n\n

Explaining Vlookup and Mid Functions<\/h2>\n\n\n\n

To show how these two functions operate together, we will first inspect each of these formulas separately:<\/p>\n\n\n\n

    \n
  1. VLOOKUP formula<\/strong> searches for a value in the first column of a certain range (in most cases table) and then it returns a corresponding value from that column in the same row. The syntax of VLOOKUP<\/strong> is:<\/li>\n<\/ol>\n\n\n\n
    =VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])<\/code><\/pre>\n\n\n\n
      \n
    • lookup_value:<\/strong> The value we are searching for.<\/li>\n\n\n\n
    • table_array:<\/strong> The range of cells where we are performing the search.<\/li>\n\n\n\n
    • col_index_num:<\/strong> The column number (1-based index)<\/strong> from which we want to retrieve the result.<\/li>\n\n\n\n
    • range_lookup:<\/strong> Optional.<\/strong> If TRUE (or omitted), an approximate match is performed; if FALSE, an exact match is performed.<\/li>\n<\/ul>\n\n\n\n
        \n
      1. A MID function<\/strong> is used to extract a specific number of characters from a text string, starting at a specified position. Its basic syntax is:<\/li>\n<\/ol>\n\n\n\n
        =MID(text, start_num, num_chars)<\/code><\/pre>\n\n\n\n
          \n
        • text:<\/strong> The text string from which we want to extract characters.<\/li>\n\n\n\n
        • start_num:<\/strong> The position of the first character we want to extract.<\/li>\n\n\n\n
        • num_chars:<\/strong> The number of characters that we are extracting.<\/li>\n<\/ul>\n\n\n\n

          Combining VLOOKUP and MID formula<\/h2>\n\n\n\n

          For our example, we will use the list of products, their codes, and sales records. Products will be Product A, B, and C<\/strong>:<\/p>\n\n\n\n

          \"\"<\/figure>\n\n\n\n

          Now, let\u2019s suppose that the product code originally consisted of both numbers and letters and that we have one original code looking like this:<\/p>\n\n\n\n

          ABC123ABC and GHI789GHI<\/strong><\/p>\n\n\n\n

          We will store it in cells E2 and E3<\/strong>. Now there is a clear pattern here in which the shortened codes (number) begin from the fourth character<\/strong> in this extended code.<\/p>\n\n\n\n

          Now, if we want to find the sales of the original codes, we can do it with VLOOKUP and MID<\/strong>. In cell F2<\/strong> we will insert the following formula:<\/p>\n\n\n\n

          =VLOOKUP(MID(E2,4,3),A:C,3,0)<\/code><\/pre>\n\n\n\n

          But we will be returned with an error:<\/p>\n\n\n\n

          \"\"<\/figure>\n\n\n\n

          This formula uses the result in our MID formula as a lookup value<\/strong>. MID formula retrieves three numbers from our designated cell starting from the fourth character<\/strong>. The table array<\/strong> for our VLOOKUP are columns A:C<\/strong>, and we are searching for the sales values, located in the third column<\/strong>.<\/p>\n\n\n\n

          But why do we get an error? The reason why this happens is that the MID function is a string function<\/strong> that always returns TEXT format<\/strong>. We are obviously looking for a number in our case. To change this, we need to add the VALUE formula<\/strong>, which has only one parameter – TEXT <\/strong>(this formula basically converts text to number). Our formula will now be:<\/p>\n\n\n\n

          =VLOOKUP(VALUE(MID(E2,4,3)),A:C,3,0)<\/code><\/pre>\n\n\n\n

          And we will get the expected result:<\/p>\n\n\n\n

          \"\"<\/figure>\n\n\n\n

          Now, this example is extremely simplified, but it shows a combination of formulas that can be used in more complex situations and datasets.<\/p>\n","protected":false},"excerpt":{"rendered":"

          Excel formulas are made in a way that complicated things can seem easy. There is always an option to combine the formulas to…<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[170],"yoast_head":"\nExcel VLOOKUP and MID for Data Analysis<\/title>\n<meta name=\"description\" content=\"Download the Excel file that demonstrates how to combine VLOOKUP and MID formulas for data analysis. Get valuable information from your data set.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel VLOOKUP and MID for Data Analysis\" \/>\n<meta property=\"og:description\" content=\"Download the Excel file that demonstrates how to combine VLOOKUP and MID formulas for data analysis. Get valuable information from your data set.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-24T16:48:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-19T14:52:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png\" \/>\n<meta name=\"author\" content=\"Harun Spahic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Harun Spahic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/\"},\"author\":{\"name\":\"Harun Spahic\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2\"},\"headline\":\"Excel VLOOKUP and MID for Data Analysis\",\"datePublished\":\"2023-08-24T16:48:02+00:00\",\"dateModified\":\"2024-02-19T14:52:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/\"},\"wordCount\":508,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png\",\"keywords\":[\"file\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/\",\"name\":\"Excel VLOOKUP and MID for Data Analysis\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png\",\"datePublished\":\"2023-08-24T16:48:02+00:00\",\"dateModified\":\"2024-02-19T14:52:06+00:00\",\"description\":\"Download the Excel file that demonstrates how to combine VLOOKUP and MID formulas for data analysis. Get valuable information from your data set.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage\",\"url\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png\",\"contentUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png\",\"width\":353,\"height\":120},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel VLOOKUP and MID for Data Analysis\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2\",\"name\":\"Harun Spahic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g\",\"caption\":\"Harun Spahic\"},\"sameAs\":[\"http:\/\/human.bsru.ac.th\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Excel VLOOKUP and MID for Data Analysis","description":"Download the Excel file that demonstrates how to combine VLOOKUP and MID formulas for data analysis. Get valuable information from your data set.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/","og_locale":"en_US","og_type":"article","og_title":"Excel VLOOKUP and MID for Data Analysis","og_description":"Download the Excel file that demonstrates how to combine VLOOKUP and MID formulas for data analysis. Get valuable information from your data set.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/","article_published_time":"2023-08-24T16:48:02+00:00","article_modified_time":"2024-02-19T14:52:06+00:00","og_image":[{"url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png"}],"author":"Harun Spahic","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Harun Spahic","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/"},"author":{"name":"Harun Spahic","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2"},"headline":"Excel VLOOKUP and MID for Data Analysis","datePublished":"2023-08-24T16:48:02+00:00","dateModified":"2024-02-19T14:52:06+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/"},"wordCount":508,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png","keywords":["file"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/","url":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/","name":"Excel VLOOKUP and MID for Data Analysis","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png","datePublished":"2023-08-24T16:48:02+00:00","dateModified":"2024-02-19T14:52:06+00:00","description":"Download the Excel file that demonstrates how to combine VLOOKUP and MID formulas for data analysis. Get valuable information from your data set.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#primaryimage","url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png","contentUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16209-1.png","width":353,"height":120},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/excel-vlookup-and-mid-for-data-analysis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel VLOOKUP and MID for Data Analysis"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."},{"@type":"Person","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2","name":"Harun Spahic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g","caption":"Harun Spahic"},"sameAs":["http:\/\/human.bsru.ac.th\/"]}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/16209"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=16209"}],"version-history":[{"count":1,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/16209\/revisions"}],"predecessor-version":[{"id":16214,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/16209\/revisions\/16214"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=16209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=16209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=16209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}