+ Reply to Thread
Results 1 to 8 of 8

Getting the last minute from the minute() function

Hybrid View

  1. #1
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Smile Getting the last minute from the minute() function

    I can get the minute of 42341.9771299769 by using =minute(42341.9771299769); is it possible to get the last minute only of the minute? So if the minute is 5, output 5, if 9, output 9, if 13, then 3, if 28, then 8, if 45, then 5, an so on... Could use either a formula or VBA, whatever is easiest.

    Thanks
    Last edited by luv2glyd; 12-04-2015 at 01:30 PM.
    You either quit or become really good at it. There are no other choices.

  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
    53,049

    Re: Getting the last minute from the minute() function

    This is a bit long winded, but it works...
    A
    B
    1
    Thursday, December 03, 2015 23:27:04
    7

    B1=--MID(TEXT(A1,"m.s"),2,1)
    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
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Getting the last minute from the minute() function

    or
    =MOD(MINUTE(A1),10)
    Samba

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

  4. #4
    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
    53,049

    Re: Getting the last minute from the minute() function

    Thanks Siva, I knew I was over-complicating that

  5. #5
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: Getting the last minute from the minute() function

    Ok, thank you both. Is there also a way to do this in VB? I tried using the Mod as a WorksheetFunction, but does not seem to work.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Getting the last minute from the minute() function

    Mod is an operator in VBA:

    myMinute = minute(someDate) mod 10
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Valued Forum Contributor luv2glyd's Avatar
    Join Date
    07-13-2008
    Location
    Seattle, WA, US
    MS-Off Ver
    Excel 2010
    Posts
    679

    Re: Getting the last minute from the minute() function

    Great! Thank you.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Getting the last minute from the minute() function

    You're welcome.

+ 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. how to run a macro on the minute every minute
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2015, 08:33 PM
  2. [SOLVED] Record on/off time for minute by minute data set
    By bdenzer in forum Excel General
    Replies: 5
    Last Post: 07-30-2015, 07:41 PM
  3. Replies: 2
    Last Post: 11-27-2013, 01:26 PM
  4. [SOLVED] Macro that runs every minute when System Clock changes minute?
    By naira in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2013, 04:11 PM
  5. Correspond Dates to Minute by Minute Data
    By chubby127 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2013, 05:50 AM
  6. rolling minute data into 30 minute averages
    By grc1980 in forum Excel General
    Replies: 0
    Last Post: 08-30-2006, 03:58 PM
  7. [SOLVED] convert time from 60 minute hour to 100 minute hour
    By Jboerding in forum Excel General
    Replies: 2
    Last Post: 07-06-2005, 06:30 PM

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