You are here:

Excel/Using IF statements

Advertisement


Question
I am trying to use an IF statement to automatically determine a value of a cell (A1) based on the value of another cell (B1).  However, A1 has a static number based on a series of consecutive numbers, for example, if the value of A1 is 214-286 then B1=38.  If the value of A1 is 287-300 then B1=40.  I was trying to do it like this =IF(A1=214:286,38,IF(A1=287:300,40,"N/A"))  However, it is not working.  Your knowledge would be greatly appreciated.  Thank you in advance.

Answer
Not clear from the question how many possible values you need to check, so you MAY run into a problem if it requires more than 7 nested bracket levels - at which point, I'd switch to using a lookup table.  But to fix the formula as it stands

=IF(AND(A1>=214,A1<=286),38,IF(and(A1>=287,A1<=300),40,"N/A"))  
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.