View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John C[_2_] John C[_2_] is offline
external usenet poster
 
Posts: 1,358
Default Nested Ifs in 2007

Well, assuming that the 5 combinations that you list are the only
possibilities, i.e.: (in other words, YES / YES / NO / YES isn't valid, and
cannot be chosen that way), you could just count the YES's in your cells,
(0-4), and set up a table on your other sheet and do a VLOOKUP.
Say for example, your questions are answered YES or NO in Sheet1 range D4
through D7
On sheet 2, you have in cells A2 to A6 the values 0 to 4, and in cells B2 to
B6 the corresponding 'answer' for your selections (obviously B2 would be the
answer for all 4 No's, and B6 would be the answer to all 4 Yes's).
Then on sheet1, you could put a formula into, for example, cell D10
D10:
=IF(AND(D4<"",D5<"",D6<"",D7<""),VLOOKUP(COUNT IF(D4:D7,"Yes"),Sheet2!$A$2:$B$6,2,FALSE)

If you run into trouble, look for help on the VLOOKUP function, or post back.
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"NHMcCormick07" wrote:

I have a survey sheet where users have 4 questions to answer Yes or No to.
Depending on the combination of Yes's and No's, I need to return a certain
cell value from another worksheet.
There are 5 possible combinations (1=No, No, No, No/ 2=Yes, No, No, No/3=
Yes, Yes, No, No /4=Yes, Yes, Yes, No /5=Yes, Yes, Yes, Yes). So, for
example, if a user responds "No, No, No, No" I need the cell containing the
formula to return a value that is in another worksheet. The other value is
the "solution" so to speak to their responses. If they answer No to all the
questions, then the answer to their problem is the text that is in a cell on
the corresponding worksheet.
I am a MOUS trainer and a student has asked me to help them out with this
and I am stumped!
Thanks!