range of different dates and times<\/strong>.<\/p>\n\n\n\nMatch Date to a Range of Dates and Times<\/h2>\n\n\n\n For our example, we will use the list of random dates and times<\/strong>, all in 2015<\/strong>, and different revenues<\/strong> that a company achieved for that date:<\/p>\n\n\n\n <\/figure>\n\n\n\nThe easiest way to find the revenue that we want is to use the VLOOKUP function<\/strong>. This function is usually used with numbers, but since dates in Excel are just numbers formatted differently, we can use it with ease to get desired results.<\/p>\n\n\n\nSince we have a date and time together at our table, we must use VLOOKUP<\/strong> in a smart way.<\/p>\n\n\n\nIf we type in the date 3\/26\/2015<\/strong> in cell E2<\/strong> and input the VLOOKUP formula<\/strong><\/p>\n\n\n\n=VLOOKUP(E2,A1:B14,2,0)<\/code><\/pre>\n\n\n\nin cell E3<\/strong> to find this date in the table, we will be returned an error:<\/p>\n\n\n\n <\/figure>\n\n\n\nThe reason for the error is the fact that we used 0<\/strong>, or FALSE<\/strong>, for range_lookup<\/strong>, which means we are searching for an exact match, and our date was formatted with a custom time, which will always be set to 00:00:00.<\/strong> To remove the error, we need to precise the time we search for, or we need to type in 1<\/strong>, or TRUE<\/strong>, for range_lookup value<\/strong>:<\/p>\n\n\n\n=VLOOKUP(E2,A1:B14,2,1)<\/code><\/pre>\n\n\n\n <\/figure>\n\n\n\nMatch Date to a Range of Dates and Times Formatted as Text<\/h2>\n\n\n\n This happens often in Excel when, for some reason, we have our dates formatted as Text<\/strong>. This can happen, for example, when exporting from CSV<\/strong>. We will use the same numbers for our example, and will notice an error returned when using VLOOKUP<\/strong> from the previous example:<\/p>\n\n\n\n <\/figure>\n\n\n\nTo resolve this issue, we need to convert our lookup_value<\/strong> (in our case, cell K2<\/strong>) to TEXT<\/strong>. This is the VLOOKUP function<\/strong> variation that we need to insert:<\/p>\n\n\n\n=VLOOKUP(TEXT(K2,\"M\/D\/YYYY\")&\"*\",G1:H14,2,1)<\/code><\/pre>\n\n\n\nThis formula converts our lookup_value<\/strong> to text and it also omits all the values after that, by concatenating it with the asterisk<\/strong>. This is the result we get:<\/p>\n\n\n\n <\/figure>\n","protected":false},"excerpt":{"rendered":"There are numerous tools at our disposal when it comes to extracting data. Excel is undoubtedly one of the best of them. If…<\/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":"\n
Match Date to a Range of Dates and Times in Excel<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n