IF function with INDIRECT reference for Data Validation source causing issue

FamilyForce6

New Member
Joined
Oct 19, 2017
Messages
2
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 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.)
ERXsEErshmsdLGj5n-OL3mT7OE9scigDNoUsuDrfWs90AANv5TR0PsTDCAAj7XcJcK2shAKBHVHR3pirpbCP0ws0z2rhN3nWFpkzUIg8ROSNwXlOT4qqs01C6nYadBjqRhF1ex1V2b-ASpjnttQrFPAiZQw93iP_FTq29ZXQvXPCDGSdG-9dSK6z-6r4CXrgLQ6gvwXQyXxHgGVePLRb3s3lbObaBeNg__Po6LHYarpLR-nxJgiAHucB3McCsbPBoCn4bfxyzbA3Z5GhLanIUWkWzZDI8LW-d26r8fZXqeul2gzTWDO4TrdoxBKgt_SNojUNJBh_k91F82BheQsMqq9wFjcMF29dmrYiHlHTYDUnqm8hbBq9FD5bIoR6twOr4gNr9cuSJVrk1UVHFhnr1Ns9BDJL_zqCrKJrx3EY9hTEpBxEG482kt97-rBU94d_5K_u3w1i03F1gkgNupIUH8j0Xp3i54ea0yxjlHTYFXpVxBXTExnHbHeuelcuvcrKCxOPt8EX06-LHkB0iS_A_aVxpifMn-_MDbqdBUTazPxMrCIXx9dSg_9RCuBNDrsQcv5qK-0mV0TwzhvSQEM5_4OolY0GjzbUz2ky3DuX2uE=w1100-h548-no

rC6nbY7mk3ViZUfe2

rC6nbY7mk3ViZUfe2


rC6nbY7mk3ViZUfe2
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
If it is the INDIRECT formula being finicky perhaps you could use the INDIRECT to put the info into another cell, and then set up the Data Validation on the other cells....

Just an idea...
 
Upvote 0
Thanks for your replyChristdontm,
I received an answer similar to yours where I posted in another forum. Just for clarity here's what I did.

Here's what I did to workaround the If formula on the indirect source:
Created a hidden column (H) that had the if formula: If(G8="",$C$4,G8).
then the E8 cell source: INDIRECT(H8).

Works like a charm
 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,418
Members
449,449
Latest member
Quiet_Nectarine_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top