# Defined Names within "IF" Functions

1. ## Defined Names within "IF" Functions

Book1.xlsxI am working on a spreadsheet for my boss, and I need some help.

Attached is an example workbook that I have been playing with, much like the one I need to make, just a whole lot simpler.

Cell B3 is a drop-down box with three choices (in this case seed). He wants to be able to pick a seed, then a separate drop-down box come down in C4 depending on his choice in B3. The function I have in is as follows:

=IF(B3=DATA!A1,CORN,IF(B3=DATA!A2,COTTON,IF(B3=DATA!A3,SOYBEAN)))

(The text in blue is the inserted defined name)

I have tried =IF(B3="CORN",CORN,IF(B3="COTTON",COTTON,IF(B3="SOYBEAN",SOYBEAN))) as well.

All I get is #VALUE!.

Is this even possible to get a drop-down menu from another drop-down menu? Each seed has its own.

2. ## Re: Defined Names within "IF" Functions

You need to put that formula in Data Validation

On the Data Tab, click Data Validation
Select List
Enter that formula in the Source Box

3. ## Re: Defined Names within "IF" Functions

Hi and welcome to the forum

You can do this with the INDIRECT() function, see the attached for an example on how to do it...

4. ## Re: Defined Names within "IF" Functions

I can't find an example formula. I see how it works, but what does the formula look like?

Thanks!

5. ## Re: Defined Names within "IF" Functions

That didn't work. @Jonmo1

6. ## Re: Defined Names within "IF" Functions

Originally Posted by emilydsmith
That didn't work. @Jonmo1
Sure it did, see Cell C4

emilydsmithEF.xlsx

7. ## Re: Defined Names within "IF" Functions

it is done through DV. click on the 2nd dropdown, and then go into the DV window, you will see the formula in there

8. ## Re: Defined Names within "IF" Functions

Thank you so much! I don't know how I was doing it differently but thank you!

9. ## Re: Defined Names within "IF" Functions

you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

10. ## Re: Defined Names within "IF" Functions

You're welcome.

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