+ Reply to Thread
Results 1 to 13 of 13

Extract Find and Concatenate

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2010
    Posts
    92

    Extract Find and Concatenate

    Attached a sample sheet,

    What i need is the following

    I have two columns,

    Column B Trigger Name List, which each cell has either one value, or multiple

    Column C Escalation Timestamp: which is a Date Time format

    I can change the Date time format to general to give me a number like 55000

    I need to be able to extract / find the count of a specific value from column B, lets say : Account number

    that falls between a range of date, ex. from 06/04/2012 10:49:07 AM to 06/14/2012 1:58:20 AM

    Pulled all my hair, not able to make it happen, hope you can.
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,959

    Re: Extract Find and Concatenate

    try this...
    =COUNTIFS(B5:B16,B5,C5:C16,">="&C2,C5:C16,"<="&C3)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-10-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: Extract Find and Concatenate

    I tried gave Zero

    corrected it to

    =COUNTIFS(B5:B16,B5,C5:C16,">="&C5,C5:C16,"<="&C16)

    as C2 & C3 are blank cells


    but still the count is wrong

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Extract Find and Concatenate

    Oceans,

    Attached is a modified version of your provided workbook.
    In cell E1 is where you enter the start day & time
    In cell E2 is where you enter the end day & time
    In cell E3 is where you enter the trigger name
    In cell E4 is this formula:
    Please Login or Register  to view this content.

    Using your provided data with Start = 6/4/2012 10:49:07 AM, End = 6/14/2012 1:58:20 AM, and Trigger Name = Account Number, the formula returns a count of 2. I verified that is correct by hand.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    10-10-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: Extract Find and Concatenate

    I appreciate your help, was not able to reply earlier.

    yes the formula you put together works as a charm................Thanks,

    But, i wonder if it is possible when you have a chance, to give a break down of the formula

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Extract Find and Concatenate

    Oceans,

    All of the formulas provided are essentially the same: they all utilize the Countifs() function.
    Here is a breakdown of my formula:

    In cell E1 is the start day & time
    In cell E2 is the End day & time
    In cell E3 is the Trigger name

    The formula starts with an IF statement. The purpose is to determine if all of the criteria has been provided. The formula verifies if all of the criteria has been provided by checking these conditions:
    E2<E1
    COUNT(E1:E2)<2
    E3=""

    -If E2 (the ending day & time) is less than (earlier) than E1 (the starting day & time), then the criteria is invalid (can't have an ending time that is prior to the start time)
    -The Count() function returns the number of numerical entries in a range of cells. Excel considers dates and times to be numerical entries. So if the count of numerical entries in E1 and E2 (the start and end date/times) is less than 2, which means that one or both has not been entered or the date was entered in a format Excel doesn't recognize, then the criteria is invalid (because it hasn't been fully provided)
    -If E3 (the trigger name) equals blank, then the criteria is invalid (nothing has been provided for the trigger name)

    So the IF statement checks those three conditions, and if any of them are true then the criteria is invalid and the formula returns a blank. If none of them are true then the IF statement proceeds to the Countifs() portion of the formula:
    COUNTIFS(A2:A13,"*"&E3&"*",B2:B13,">="&E1,B2:B13,"<="&E2)

    This checks column A for the trigger name using the wild card character "*". So it is essentially looking for cells in column A that contain the trigger name. Then it checks column B twice. First it checks for cells in column B that are greater than or equal to the start day & time. Next it looks for cells in column B that are less than or equal to the end day & time. Now that the countifs has checked for each criteria, it returns a count where all critiera was successfully met.

  7. #7
    Registered User
    Join Date
    10-10-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: Extract Find and Concatenate

    I do appreciate you taking the time to make it clear,

    however, you typed :
    " if any of them are true then the criteria is invalid and the formula returns a blank. If none of them are true then"

    Did you mean
    "if any of them are FALSE then the criteria is invalid and the formula returns a blank. If none of them are true then"

  8. #8
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Extract Find and Concatenate

    Oceans,

    Nope, I typed it correctly. If any of the conditions are are true, the criteria is invalid. Each condition is a test for invalid criteria, so if any condition is true, the criteria is invalid. Only if all test are false does it mean that the criteria is valid.

  9. #9
    Registered User
    Join Date
    10-10-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: Extract Find and Concatenate

    Got it,

    I have tried to add one more thing to the formula, but no success so far,

    Lets say i would like to add another criteria in cell K3

    So i tried

    =IF(OR(J2<J1,COUNT(J1:J2)<2,J3&K3=""),"",COUNTIFS(L7:L17331,"*"&J3&K3&"*",R7:R17331,">="&J1,R7:R17331,"<="&J2))

    Also tried

    =IF(OR(J2<J1,COUNT(J1:J2)<2,(J3:k3)=""),"",COUNTIFS(L7:L17331,"*"&J3&K3&"*",R7:R17331,">="&J1,R7:R17331,"<="&J2))


    not working

  10. #10
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Extract Find and Concatenate

    are you looking for it to have 2 trigger words in the same cell? if that is the case:
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-10-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: Extract Find and Concatenate

    Works,.


    Perfect,.


    With your experience, how can i learn how to put together formulas like this ??

  12. #12
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Extract Find and Concatenate

    Its just practice really. When I first joined this forum, I thought I knew Excel. Then I realized just how much I didn't know. I knew enough to start solving problems, and I'd check on threads I couldn't solve and see if I could teach myself how they got that formula working, or why they used that bit of VBA, etc. Combined with a lot of google and my own testing, its now 21 months later and my proficiency has enormously increased. So its just practice. And like they say, "Experience is the best teacher."

  13. #13
    Registered User
    Join Date
    10-10-2012
    Location
    Dallas
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: Extract Find and Concatenate

    Got you....Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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