+ Reply to Thread
Results 1 to 4 of 4

IF function with INDIRECT reference for Data Validation source causing issue

  1. #1
    Registered User
    Join Date
    06-18-2012
    Location
    Denver
    MS-Off Ver
    Excel 2016
    Posts
    3

    IF function with INDIRECT reference for Data Validation source causing issue

    Hi all,
    I've created a spreadsheet for our company's credit card expense reports that has dependent data lists for showing valid account numbers in a drop down (Column E) based on the home department of the employee for whom the report is being completed. The workbook worked great until I revised it this year adding a column that allowed for the "home" department to be over-ridden on any individual line item to use a valid account number from a different department.

    I used the following formula in the Data Validation source: "=IF(G8="",INDIRECT($C$4),INDIRECT(G8))" where C4 is the home department and G8 is the Department over-ride.

    This works with one exception. When the G8 (Dept Over-ride) is left blank the account number can be filled with any text/data without a validation error. I'm wondering how I fix this to make sure that only approved data is able to be entered in?

    (The validation error does work properly when there is data in cell G8.)
    Mr. Excel 1.PNG
    Last edited by FF6; 10-25-2017 at 12:31 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: IF function with INDIRECT reference for Data Validation source causing issue

    It doesn't quite work like that, I'm afraid. however, it can be done. One the attached sheet, I have 7 cells G8:G14 - the manual over-ride.

    Then (put this where you store all your data for your named ranges), I used (in O2 to O9), a formula to tell Excel which DV list to use:

    =IF(G8="",$C$4,G8)

    Then the DV formula in the target cells (I used the greenish cells Q2-Q9) becomes simply
    =INDIRECT(O2)

    and then Bingo... it works
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 10-20-2017 at 12:12 PM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    06-18-2012
    Location
    Denver
    MS-Off Ver
    Excel 2016
    Posts
    3

    Thumbs up Re: IF function with INDIRECT reference for Data Validation source causing issue

    Thank you. This makes sense, just create a hidden column that returns the value of the department. Worked like a charm.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: IF function with INDIRECT reference for Data Validation source causing issue

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] Use INDIRECT to build a dynamic reference is causing #REF error
    By CWatsonJr in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-27-2017, 02:37 PM
  2. Replies: 5
    Last Post: 07-29-2015, 08:36 AM
  3. inserting row causing formula reference issue
    By rexer231 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2014, 12:52 PM
  4. Replies: 0
    Last Post: 01-09-2013, 11:44 AM
  5. Replies: 3
    Last Post: 07-20-2012, 09:52 AM
  6. Data validation issue : multi row and col source
    By tanwt in forum Excel General
    Replies: 0
    Last Post: 08-01-2011, 06:15 AM
  7. [SOLVED] Using INDIRECT function to specify source data
    By donesquire in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-26-2005, 11:05 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