Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: IF statement help please

Status
Not open for further replies.

norty303

Technical User
Jul 23, 2003
416
GB
Probably an obvious one this but I've been using SQL for a while and now i'm back with Excel and can't remember the equivalent *blush*

I want to do a nested IF where i'm testing on multiple values. I'd normally use a LIKE or an IN in SQL, what's the excel equivalent?
Pseudocode:
E.G. IF(A1 IN ["Jan","Feb","Mar"],"Quarter 1",IF(A1 IN etc, etc you get the idea :)

Thanks
 
Hi norty303,

There is no direct equivalent. It rather depends on exactly what you're working with. If it's just months as in your example, there are various ways of checking them; if your data are more varied you should probably consider some sort of Lookup. A simple answer to the question as posed is to use ..

[blue][tt] IF(OR(A1="Jan",A1="Feb",A1="Mar"),"Quarter 1",IF(OR(A1 ...[/tt][/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
That's exactly what i was after Tony, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top