+ Reply to Thread
Results 1 to 5 of 5

how can we put if-condition for not getting zero-second on the cell?

  1. #1
    Registered User
    Join Date
    11-20-2019
    Location
    nepal
    MS-Off Ver
    office 2016
    Posts
    21

    how can we put if-condition for not getting zero-second on the cell?

    I'm generating the time in the excel and copying it in another software but the case is that software doesn't support zero-second this is why I want to generate the time but not having zero seconds. format I am using for time is hh:mm:ss, and am using formula =B2+TIME(0,RANDBETWEEN(14,18),RANDBETWEEN(7,17)) where B2 has the original time and am adding 14-25 minutes in it where I don't want zero seconds to come in.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: how can we put if-condition for not getting zero-second on the cell?

    Hi, welcome to the forum.
    The just pass the hours and minutes and not the seconds
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    11-20-2019
    Location
    nepal
    MS-Off Ver
    office 2016
    Posts
    21

    Re: how can we put if-condition for not getting zero-second on the cell?

    i could do that but the matter is second is compulsory, just the thing is i want second but not the **:**:00.
    Last edited by AliGW; 11-20-2019 at 07:18 AM. Reason: Please don't quote unnecessarily!

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: how can we put if-condition for not getting zero-second on the cell?

    You could use a helper column to check if there are 0 seconds, then add 1 second if true. Then pass the results from the helper column to your other software.
    For example, if your formula is in C2, put this in D2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Of course, as you are using RandBetween, the results will keep changing, so if you don't have too many results, you could instead just press F9 to recalculate until you don't have zero seconds.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  5. #5
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: how can we put if-condition for not getting zero-second on the cell?

    Thanks for the rep. If that means that you're happy that your question has been answered, then please take a moment to mark the thread as Solved so others know there's an answer here (instructions are in my sig). Thanks.

    Edit: thank you
    Last edited by Aardigspook; 11-27-2019 at 09:41 AM. Reason: OP has marked thread as Solved

+ 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: 19
    Last Post: 05-21-2019, 03:17 PM
  2. [SOLVED] Color a cell If 2 other cells meet condition, undo cell color if third cell meet condition
    By aftbrah in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-28-2016, 01:17 AM
  3. Replies: 1
    Last Post: 06-19-2013, 12:49 AM
  4. open a comment to cell range upon true condition then removing comment on false condition
    By ferrum_equitis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 12:55 AM
  5. Replies: 4
    Last Post: 05-25-2012, 04:16 AM
  6. cell colours for every 15th cell with data (condition formatting and Macro)
    By eastydie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-09-2012, 04:57 AM
  7. Select worksheet based on condition & populate cell based on condition
    By beth1069 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-19-2011, 01:27 PM

Tags for this Thread

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