#1   Report Post  
Posted to microsoft.public.excel.misc
Lynneth
 
Posts: n/a
Default How many 'if's'?


How many conditions can I put into an if statement?

I wanted to put in twelve conditions, but it will not let me go past
seven. Is this the maximum number?

=IF($A1="january",SUM($B$1:$B$3),IF($A1="February" ,SUM($B$2:$B$4),IF($A1="march",SUM($B$3:$B$5),IF($ A1="april",SUM($B$4:$B$6),IF($A1="may",SUM($B$5:$B $7),IF($A1="June",SUM($B$6:$B$8),IF($A1="july",SUM ($B$7:$B$9),0)))))))

Thank you very much
Lynne


--
Lynneth
------------------------------------------------------------------------
Lynneth's Profile: http://www.excelforum.com/member.php...o&userid=26102
View this thread: http://www.excelforum.com/showthread...hreadid=538892

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default How many 'if's'?

You are limited to 8, 7 nested, functions. Try this instead

=SUM(INDEX(B:B,MONTH(DATEVALUE("1-"&A1&"-2000"))):INDEX(B:B,MONTH(DATEVALUE(
"1-"&A1&"-2000"))+2))

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Lynneth" wrote in
message ...

How many conditions can I put into an if statement?

I wanted to put in twelve conditions, but it will not let me go past
seven. Is this the maximum number?


=IF($A1="january",SUM($B$1:$B$3),IF($A1="February" ,SUM($B$2:$B$4),IF($A1="ma
rch",SUM($B$3:$B$5),IF($A1="april",SUM($B$4:$B$6), IF($A1="may",SUM($B$5:$B$7
),IF($A1="June",SUM($B$6:$B$8),IF($A1="july",SUM($ B$7:$B$9),0)))))))

Thank you very much
Lynne


--
Lynneth
------------------------------------------------------------------------
Lynneth's Profile:

http://www.excelforum.com/member.php...o&userid=26102
View this thread: http://www.excelforum.com/showthread...hreadid=538892



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"