You are here:

Excel/complicated formula

Advertisement


Question
=IF(C3=antipsychotic, "E2+30",IF(C3=antianxiety,"E2+30",IF(C3=hypnotic,"E2+10",IF(C3=antidepressant,"E2+180"))))

What is wrong with this formula? it just give me the #NAME?

Answer
You have your quotes in the wrong places

=IF(C3="antipsychotic", E2+30,IF(C3="antianxiety",E2+30,IF(C3="hypnotic",E2+10,IF(C3="antidepressant",E2+180))))

would be the correct version I think - the quotes indicate a string value,so "antianxiety" would indicate a cell containing that as a string (text) value - e2+30 indicates to add 30 to the value of the cell E2.

Hope this helps.  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

All Answers

Answers by Expert:


Ask Experts

Volunteer


Aidan Heritage

Expertise

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards

Experience

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

Education/Credentials
I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2009 About.com, a part of The New York Times Company. All rights reserved.