+ Reply to Thread
Results 1 to 4 of 4

Data validation in if statement

Hybrid View

  1. #1
    Registered User
    Join Date
    05-20-2010
    Location
    tanjung pinang
    MS-Off Ver
    Excel 2007
    Posts
    7

    Data validation in if statement

    Hi...

    I am trying to put value from data validation into if statement
    e.g. if the data validation is "Jan", then formula like: =IF(Jan!11="","",Jan!F11), if i the data validation is "Feb" then the formula become like: =IF(Feb!F11="","",Feb!F11)
    so I can run it like a normal IF statement, is there a way?

    Thanks for your time...
    Last edited by mahoo; 02-15-2011 at 04:21 PM. Reason: solved

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,042

    Re: Data validation in if statement

    Data Validation is a way of restricting the selection of a value by various means. One of the simplest is a Drop Down Validation List.

    The value you pick from the DV List will be in a cell. So you can use that cell in your formula.

    If the DV List is on cell A2, the formula would be:

    =IF(A2="Jan",...,...)

    Or am I missing the gist of what you are asking?

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Data validation in if statement

    Sounds like you want INDIRECT but be aware it's Volatile (see link in sig. for more info.)

    =IF(INDIRECT("'"&$A$2&"'!F11")="","",INDIRECT("'"&$A$2&"'!F11"))
    where A2 holds DV cell.

    you can make the cell references in the INDIRECT dynamic by all manner of means but to illustrate we'd need a better understanding of where you are using the above (in terms of fill range and associated precedent range)

  4. #4
    Registered User
    Join Date
    05-20-2010
    Location
    tanjung pinang
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Data validation in if statement

    Quote Originally Posted by DonkeyOte View Post
    Sounds like you want INDIRECT but be aware it's Volatile (see link in sig. for more info.)

    =IF(INDIRECT("'"&$A$2&"'!F11")="","",INDIRECT("'"&$A$2&"'!F11"))
    where A2 holds DV cell.

    you can make the cell references in the INDIRECT dynamic by all manner of means but to illustrate we'd need a better understanding of where you are using the above (in terms of fill range and associated precedent range)
    worked like a charm. Thanks

+ 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