Results 1 to 6 of 6

Thread: Rounding data in Vba

  1. #1
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    13

    Rounding data in Vba

    Hi,

    From a list of dates in column B
    I used Function that returns the data in column C
    I ask what i can do to find rounding of the column D

    A B C D
    1 26/10/11 19.00 35 19.00.00 19.00
    2 26/10/11 19.04 49 19.05.00 19.00
    3 26/10/11 19.05 41 19.05.00 19.05
    4 26/10/11 19.08 20 19.05.00 19.05

    I attach a file with the data to compare, you can get in VBA this rounding in date ?

    Thanks in advance
    Attached Files Attached Files

  2. #2

  3. #3
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    Quote Originally Posted by PcMax View Post
    Hi,

    From a list of dates in column B
    I used Function that returns the data in column C
    I ask what i can do to find rounding of the column D

    A B C D
    1 26/10/11 19.00 35 19.00.00 19.00
    2 26/10/11 19.04 49 19.05.00 19.00
    3 26/10/11 19.05 41 19.05.00 19.05
    4 26/10/11 19.08 20 19.05.00 19.05
    I believe you want this formula...

    =MROUND(MOD(B3-TIME(0,2,30),1),MOD(TIME(0,5,0),1))

    You will need to format the cells using this...

    h:mm;@

  4. #4
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    13
    Hi,

    The suggestions require components of financial analysis.
    I added references and tested formulas.

    I thank Rick with the suggestion:
    =MROUND(MOD(B3-TIME(0,2,30),1),MOD(TIME(0,5,0),1))

    What is the exact matches

  5. #5
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    Quote Originally Posted by PcMax View Post
    I thank Rick with the suggestion:
    =MROUND(MOD(B3-TIME(0,2,30),1),MOD(TIME(0,5,0),1))

    What is the exact matches
    What do you mean by "What is the exact matches"? I don't understand what you are referring to.

  6. #6
    Senior Member
    Join Date
    Oct 2011
    Posts
    135
    Rep Power
    13
    Hi,

    What is the exact matches
    Rick, I translated: Google Traduttore

    I add a new post

    The data obtained are correct

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •