+ Reply to Thread
Results 1 to 5 of 5

How to apply nested IF functions in data validation

  1. #1
    Registered User
    Join Date
    10-07-2014
    Location
    Salvador da Bahia, Brazil
    MS-Off Ver
    2013
    Posts
    39

    How to apply nested IF functions in data validation

    Hi peeps.

    I've been trying to create a data validation that only allows users to enter numeric values in cells of column L if a couple of conditions are met. They are:

    If K1 < I1 then K1+L1<=I1, L1 is a positive number (bigger than 0), and L1 is mandatorily a number (no text allowed). If possible, I would also like to prevent users from entering numbers in L1 if K1 is blank (well, they may even try to, but Excel should warn them that no numbers can be entered in L1 if K1 is blank).

    I tried many things but I only managed to get to this point:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    As you guys notice, it does not meet all conditions I want to validate but honestly I don't have a clue of how to make this work. I also tried to apply the "Whole numbers" validation and pasted the conditions in the maximum value. Didn't work either.

    Any ideas of what I should do?

    Thanks.

  2. #2
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: How to apply nested IF functions in data validation

    Hi adriano.r.marques, please see attached for my solution.

    The data validation uses the following formula
    Please Login or Register  to view this content.
    Also, unchecking Ignore Blank is essential.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-07-2014
    Location
    Salvador da Bahia, Brazil
    MS-Off Ver
    2013
    Posts
    39

    Re: How to apply nested IF functions in data validation

    Hi quekbc. Thank you for your help. It did work!! It looks so simple that I feel stupid.

    Of course L2<=$I2-$K2 was the right way of saying that. I don't know what I had in mind when I wrote that dumb formula! Oh my!

    But would you mind telling me how does Excel know that no text input is permited? Is it because of the L2>0 part?

    I really appreciate your help.

  4. #4
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: How to apply nested IF functions in data validation

    Quote Originally Posted by adriano.r.marques View Post
    But would you mind telling me how does Excel know that no text input is permited? Is it because of the L2>0 part?
    Glad that worked for you! The reason why texts do not quite work in this instance is due to L2<=$I2 - $K2. When comparing texts to a number, Excel will treat any text as larger than any number. (I.e. do a sort on a list of numbers and alphabets, Excel will arrange numbers first, followed by alphabets/texts). So, a text of any kind "L2" is always "larger" than any number "I2-K2"

  5. #5
    Registered User
    Join Date
    10-07-2014
    Location
    Salvador da Bahia, Brazil
    MS-Off Ver
    2013
    Posts
    39

    Re: How to apply nested IF functions in data validation

    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. [SOLVED] Apply Data Validation on Sum Values
    By abhinavbinkar in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-31-2015, 11:31 PM
  2. [SOLVED] Data Validation custom formula - how to apply?
    By D_N_L in forum Excel General
    Replies: 3
    Last Post: 07-01-2014, 08:41 AM
  3. [SOLVED] Apply data validation in Userform
    By IKZOUHETNIETWETEN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2013, 03:03 PM
  4. Apply data validation to the whole column
    By zarab in forum Excel General
    Replies: 10
    Last Post: 09-29-2013, 09:05 AM
  5. [SOLVED] How can i apply the validation on the cell with invalid data.
    By Shinya Koizumi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2006, 04:55 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