+ Reply to Thread
Results 1 to 12 of 12

Adding if partial date string is matched

  1. #1
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    101

    Adding if partial date string is matched

    Morning All

    Sorry, having complete brain fade this morning and can't find an answer searching the forum either.

    I have 2 columns

    Column A contains a value
    Column B contains a date eg displayed as 15/5/2012

    In Column C I wish to display the value from Column A for all of the days in May 12

    This will continue for the rest of the dates which are spread over a 12 month period. I can edit these accordingly.

    Can't seem to fathom this.

    Any help would be gratefully received.

    Steven811

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Adding if partial date string is matched

    Perhaps use a Pivot Table?

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Adding if partial date string is matched

    Hi Steven811,

    If you need to add the values - lets say for the mont of May, you can use below formula:-

    {=SUM(IF((B1:B14>=DATE(2012,5,1))*(B1:B14<=DATE(2012,5,31)),A1:A14,""))}

    You need to adjust the range reference in above formula .. please press Ctrl Shift Enter key combination for above as that is an array formula.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    101

    Re: Adding if partial date string is matched

    Hi DILIPandey

    Thanks for helping.

    Basically I wish to extract values that relate to a particular month and display them in column C and they can be summed at the end.

    I tried using =IF(B10="*" & "/05/12",C10,"") but couldn't get this to work

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Adding if partial date string is matched

    Hi

    Maybe somrthing like this?

    =IF(MONTH(A1)=5,B1,"")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

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

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    101

    Re: Adding if partial date string is matched

    Hi Fotis

    Thank you. My problem is that the 5 is a partial string and I'm struggling to add the wild card syntax

    I tried using =IF(B10="*" & "/05/12",C10,"") but couldn't get this to work

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Adding if partial date string is matched

    ...Column A contains a value
    Column B contains a date eg displayed as 15/5/2012

    In Column C I wish to display the value from Column A for all of the days in May 12
    ...I tried using =IF(B10="*" & "/05/12",C10,"") but couldn't get this to work
    Steven, my poor English or(and) my Excel skills don't allow me to follow you...

    Can you upload a small sampple workbook?

  8. #8
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    101

    Re: Adding if partial date string is matched

    Hi Fotis

    Please see the example spread sheet attached.

    The empty rows show where we need the data.
    Attached Files Attached Files

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Adding if partial date string is matched

    Steven, try this

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    101

    Re: Adding if partial date string is matched

    Perfect

    Thank you

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Adding if partial date string is matched

    You are welcome!

  12. #12
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Adding if partial date string is matched

    Nothing that a simple Pivot Table could not have done...

+ 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