+ Reply to Thread
Results 1 to 12 of 12

Data validation: If previous column is having a value, then return FALSE else TRUE

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Data validation: If previous column is having a value, then return FALSE else TRUE

    Dear Friends,

    I am applying data validation in my workbook. The data in ColS consist of:

    ColS
    (Row2) X
    (Row3) Y
    (Row4) Y
    (Row5) Y
    (Row6) X

    In ColT, I am to apply data validation: i.e. If in concerned row of ColS is having "X" value, then I am to show an error message. Else, values from A2:A5 should be shown in the as list and these should be accepted in ColT.

    Thanks in advance.

    acsishere.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    you mean?

    =IF(S2="X","error message",A2)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    I already tried with this kind of formula. It doesn't work.

    I have data in sheet1!A2:A10 (range named as ReadingMat). The data is:
    A2-PHYSICS
    A3-CHEMISTRY
    A4-BIOLOGY
    A5-ZOOLOGY ...and so on.

    In sheet2, I am to do dataentry. ColS is having data like B (for Books); J (for Journals); T (for Thesis); M (for Maps).

    When I am to enter data in ColT, first I am to check ColS (of conerned row) whether "M" is there. If so, then I am to say that "Maps are not Classified". Else, I am to accept the values of ReadingMat (named range).

    Thanks in advance.

    acsishere.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I am not following then.

    I don't know what you mean by:
    Else, I am to accept the values of ReadingMat (named range).

  5. #5
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    I have attached a sample file & explained in detail, for your kind ref.

    Please give me a solution.

    Thanks in advance.

    acsishere.

  6. #6
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir, (File not attached in previous post)

    Now, the file is attached.

    Sorry for the inconvenience.

    acsishere.
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I don't believe you can do that with Data Validation when you are involving Lists.

  8. #8
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Is it not possible? Any other alternatives?

    acsishere.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Maybe with VBA and comboboxes? I am not sure.... and I am not a VBA coder.

  10. #10
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Thanks for your valuable time. If you say that it is not possible with formula, then I will try to change logical design of my worksheet.

    Thanks a lot for your guidance.

    acsishere.

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Here is a possible solution using the data validation in combination with VBA. The VBA code is connected to the spreadsheet (Right click on Sheet2 tab and "View code"). What it basically does is erases your entry if there is an "S" in column 6 (F). If not, your data validation works normally.

    The code is as follows
    Please Login or Register  to view this content.
    ChemistB
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Thanks a lot for your code. It works very nicely.

    Again, Thanks! Thanks! Thanks!

    acsishere.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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