Using If statement with two Sheets functions in one formula stops excel

I'd like to be able to create sheets either based on the Dimension one (Department Code), or on a preset range on the options page.   When I entered this formula with the If function and two NL Sheets functions, Excel faults and closes.  Is there a work around to be able to accomplish the same? 

=IF($D$2=2,NL("Sheets","G/L Entry","Department Code","0",$L$19,"Department Code",Dept,"G/L Account No.",$L$8,"Fund No.","*","Posting Date",$L$5),NL("Sheets",Options!$D$121:$D$122))



Please sign in to leave a comment.