+ Reply to Thread
Results 1 to 19 of 19

Data Validation for decimals

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Data Validation for decimals

    I have a worksheet used in HR to determine sick leave abuse. Formerly, the worksheet was set up so the user had to input time in [h]:mm. I had data validation so that the user had to enter the time with a colon. Our software has changed, and now all time is in decimals. How do I write a data validation so that the user must input time in decimals? I want a popup telling them to input it in decimal format if they try to enter it in h:mm.

  2. #2
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    Go to Data > Data Validation > Allow > Decimal

    Don't forget to update the Error Alert Message
    If I've helped U pls click on d *Add Reputation

  3. #3
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    Unfortunately, it's not that easy. When you click on decimal, you have to select from the drop-down box, and I have no idea how to specify it further.

    Decimal.jpg

  4. #4
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    If you're referring to time then you can use Greater than and put in 0

  5. #5
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    Sorry, but that doesn't work. Everything I have tried will convert what is entered into a decimal instead of alerting the user to enter it correctly. I just did what you suggested and entere 1:45 (1 hour 45 minutes) using the colon, and it changed it to 0.07.

  6. #6
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    This is what you said:

    How do I write a data validation so that the user must input time in decimals?

    So you need to enter 1:45 as 1.45 (decimal)

  7. #7
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    The whole purpose of the validation is for when a user doesn't do it correctly - it will then prompt them to input it correctly. My users are used to putting in time as h:mm. Now we are wanting them to change what they are used to. This is a safeguard so that they do not enter the time incorrectly. As I said before, in the past if they entered time as a decimal (1.75 instead of 1:45 for 1 hour 45 minutes), the data validation would tell them their time was entered incorrectly and to input time as h:mm. Now I want the reverse.

  8. #8
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    so how do you want your users to enter 1:45?

    Decimal [h]:mm format
    0.572916667 13:45
    0.072916667 1:45

  9. #9
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    They need to enter it as 1.75.
    Last edited by lucy61176; 07-16-2015 at 03:44 PM.

  10. #10
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    Maybe it will help if you see what the previous worksheet looked like when the user did it opposite of what I am trying to accomplish. If the user inputed time using a decimal but really meaning to use a colon, such as 1.45 instead of 1:45, an alert would popup and tell them the time was inputted incorrectly and to input time as h:mm. (Ignore the total in the gray box.) I now need it to do the opposite but do not know how to do the data validation to accomplish this.

    Hours-Minutes.jpg
    Last edited by lucy61176; 07-16-2015 at 04:03 PM.

  11. #11
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    ok. so choose Custom and this formula:

    =FIND(".",A2,1)>=LEN(A2)-2

    Go to Error Alert tab then type: Must enter time as 0.00. Increase decimal places to your preference.

  12. #12
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    It says there is an error, and I copied and pasted what you suggested.

  13. #13
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    just click yes

  14. #14
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    What about entering 1.00 or 1? It doesn't allow that but it does allow less than 1, such as 0.5. How do I fix it so that it allows you to enter the value of 1?

  15. #15
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    if that is the case then you need to use this formula:

    =A2=INT(A2*10000)/10000

    that will allow a whole number to be entered in the cell

  16. #16
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    This appears to be it and what I have been looking for. Thanks for your help!

  17. #17
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    where are you entering the formula? what cells/column?

  18. #18
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: Data Validation for decimals

    ok great. Please mark this thread as SOLVED and consider adding a reputation

  19. #19
    Registered User
    Join Date
    06-25-2014
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    17

    Re: Data Validation for decimals

    I forgot to change A2 to the cell I was actually in so it works for me. Got it now. Thanks again!

+ 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: 3
    Last Post: 06-04-2015, 02:27 PM
  2. Replies: 2
    Last Post: 02-13-2015, 07:36 AM
  3. [SOLVED] Data Validation: How to clear/delete the content of the cell and not Data Validation List?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-07-2015, 09:42 AM
  4. Replies: 4
    Last Post: 12-19-2013, 10:44 AM
  5. Using Defined Names with Data Validation Depend and Data Validation Multi Select
    By Vinnie Chan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-01-2012, 05:36 PM
  6. Data Validation (Specific Decimals or Whole #)
    By testes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-06-2005, 09:14 PM
  7. convert text to data with decimals
    By Ulf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2005, 10:06 AM

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