Using excel if function with data validation

Closed
yvajit - Jul 7, 2009 at 10:59 PM
 slashzed - Mar 31, 2010 at 04:10 AM
Hello,

i am running EXCEL 2007.

i am trying to make an if statement that accomplishes something like, If c1=b1 then d1 = pick a choice from the data validation list(drop down list) that is from e1 to e5. else pick a choice from the data validation list(drop down list) that is from f1 to f5.

i am new to running macros in excel. pls advise how I need to insert a macro for a particular cell and then copy it to the other cells below it i.e for d2,d3..etc to chk for c2,c3,..etc

thanks

3 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Jul 12, 2009 at 08:41 PM
am not sure whether I have understood your question correctly
according to me no need of a macro

you have validation in the cells E1 to E5 and also F1 to F5

type the following formula in D1
=IF(C1=B1,E1,F1)
if there is not entry in E1 or F1 (that is if you have not used the validation) then D1 will be zero
once you choose a validation is used to enter a value in E1 or F1 then D1 will change accordingly. try some experiments

copyp D1 down upto D5.
21
well my requirement wasn't exactly the same as explained above but your explanation helped me fixing my own problem. Thanks a lot dude. I appreciate that!
0
I too need an answer for your question,,,, I have asked many no answer yet they say v cant do it, however am confident about excel there has to be a way for it
0
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Mar 26, 2010 at 12:03 PM
0