+ Reply to Thread
Results 1 to 5 of 5

Extracting date from different text values

Hybrid View

  1. #1
    Registered User
    Join Date
    06-14-2021
    Location
    Berlin
    MS-Off Ver
    16.49
    Posts
    13

    Extracting date from different text values

    Hello everyone,

    I need a formula that can identify different text values (three countries) and match them with a date.

    In the attachment, I need the formula to search for the text value "Dominican Republic" or "Jamaica" or "Bahamas" in the range and match the earliest date.

    I explained what the formula is supposed to do in the excel file.

    Thanks a lot for your help.
    Attached Files Attached Files
    Last edited by JPSExcel; 08-24-2021 at 06:30 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,744

    Re: Extracting date from different text values

    A Power Query Solution:

    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Day", Int64.Type}, {"Season", type any}, {"Date", type date}, {"Location", type text}}),
        #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Season"}),
        #"Filtered Rows" = Table.SelectRows(#"Removed Columns", each [Location] = "Jamaica" or [Location] = "Bahamas" or [Location] = "Dominican Republic"),
        #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Location"}, {{"Earliest", each List.Min([Date]), type nullable date}})
    in
        #"Grouped Rows"
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extracting date from different text values

    Hi,

    =INDEX(D18:D47,-LOOKUP(0,-MATCH({"Jamaica","Dominican Republic","Bahamas"},E18:E47,0)))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Registered User
    Join Date
    06-14-2021
    Location
    Berlin
    MS-Off Ver
    16.49
    Posts
    13

    Re: Extracting date from different text values

    Quote Originally Posted by XOR LX View Post
    Hi,

    =INDEX(D18:D47,-LOOKUP(0,-MATCH({"Jamaica","Dominican Republic","Bahamas"},E18:E47,0)))

    Regards
    Thank you so much! This solved my problem.
    Have a great day.

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extracting date from different text values

    You're welcome!

    Cheers

+ 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. Extracting column text values
    By Byebye14 in forum Excel General
    Replies: 8
    Last Post: 03-06-2020, 10:52 AM
  2. [SOLVED] Extracting Unique Values Categorized by Date
    By EXCELBENCH in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-02-2018, 03:48 AM
  3. [SOLVED] Extracting Date from text and formatting to date
    By Jietoh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-16-2016, 03:43 PM
  4. [SOLVED] Extracting a date from text in a cell
    By gedwards913 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-22-2015, 08:09 AM
  5. Extracting last date in text string
    By mmaya4 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-19-2014, 01:45 PM
  6. Extracting a Date from a text string
    By andrewc in forum Excel General
    Replies: 6
    Last Post: 09-22-2009, 06:44 AM
  7. extracting values in a specific text
    By darkhangelsk in forum Excel General
    Replies: 8
    Last Post: 08-18-2009, 11:02 AM

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