+ Reply to Thread
Results 1 to 11 of 11

Output a date if another date is a certain value

  1. #1
    Registered User
    Join Date
    02-17-2018
    Location
    Missoula
    MS-Off Ver
    Mac 2011
    Posts
    10

    Output a date if another date is a certain value

    Hi there,


    I have a list of payments coming in, and the date they arrived. So for example in 2017-18 I have

    30 Mar 2017 Mr Smith $1000
    30 Apr 2017 Mr Jones $1000
    30 Nov 2017 Mr White $1000
    30 Jan 2017 Mr Brown $1000

    In a separate column called "Apply to period ending:" it should say "1 Feb 2018" for all these payments (since they were paid between 2nd Feb 2017 and 1 Feb 2018).

    I can't figure out how to do this, can anyone help?

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Output a date if another date is a certain value

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    02-17-2018
    Location
    Missoula
    MS-Off Ver
    Mac 2011
    Posts
    10

    Re: Output a date if another date is a certain value

    Here it is
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-17-2018
    Location
    Missoula
    MS-Off Ver
    Mac 2011
    Posts
    10

    Re: Output a date if another date is a certain value

    And here's what I want it to look like but with me having to copy and paste it for a whole list of figures with different years
    Attached Files Attached Files

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Output a date if another date is a certain value

    d2=DATE(YEAR(A2-32)+1,2,1)
    Try this and copy towards down
    In A3 and A4 Names are associated with Dates please remove them to get result otherwise will get error
    30 Apr 2017 Mr Jones
    30 Nov 2017 Mr White

  6. #6
    Registered User
    Join Date
    02-17-2018
    Location
    Missoula
    MS-Off Ver
    Mac 2011
    Posts
    10

    Re: Output a date if another date is a certain value

    That works perfectly - but I have absolutely no idea why!

    Could you explain how it works? Many thanks for the solution

  7. #7
    Registered User
    Join Date
    02-17-2018
    Location
    Missoula
    MS-Off Ver
    Mac 2011
    Posts
    10

    Re: Output a date if another date is a certain value

    Also it is not working if the payment date was Feb 1st.

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Output a date if another date is a certain value

    Quote Originally Posted by fandiwany View Post
    Also it is not working if the payment date was Feb 1st.
    you said that only the dates between 02-02-2017 and 01-02-2018 to be displayed as 01-02-2018
    for 01-02-2018 it will show as 01-02-2018
    for 01-02-2017 it will show as 01-02-2017

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Output a date if another date is a certain value

    wrong post

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Output a date if another date is a certain value

    Quote Originally Posted by fandiwany View Post
    That works perfectly - but I have absolutely no idea why!

    Could you explain how it works? Many thanks for the solution
    ---

    in the given case
    1 Feb 2018 to be shown for all the days between 2nd Feb 2017 and 1 Feb 2018.
    in this case total 32 days are in the year 2018 and remaining are in 2017 so if you deducted 32 from any dates between 2-02-2017 and 01-02-2018 it will be always in the year 2017 only, so I am adding 1 to the year 2017 (2017+1=2018)

  11. #11
    Registered User
    Join Date
    02-17-2018
    Location
    Missoula
    MS-Off Ver
    Mac 2011
    Posts
    10

    Re: Output a date if another date is a certain value

    Ah yes I understand now. I couldn't see what the 32 was doing. Genius!

    धन्यवाद!

+ 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. Replies: 0
    Last Post: 08-01-2015, 12:29 AM
  2. [SOLVED] Target Date to Completed Date Comparison Percentage output
    By FNG_to_Excel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2015, 12:32 PM
  3. Replies: 1
    Last Post: 04-22-2015, 08:08 AM
  4. [SOLVED] need help to lookup a (workday) date, and then excel output to show that date minus 1
    By Marijke in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-23-2013, 11:13 AM
  5. Current date to output required Date.
    By jay1983 in forum Excel General
    Replies: 3
    Last Post: 11-12-2009, 08:00 PM
  6. incorrect date output when time and date strikes 12 midnight
    By stoey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-22-2009, 10:04 AM
  7. date output
    By excellentexcel in forum Excel General
    Replies: 7
    Last Post: 05-19-2009, 11:49 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