I have six columns next to each other and am trying to add date based on the
month in every other column.
M8 N8 O8 P8 Q8 R8
$200 April $100 May $100 April
Then trying to have the formula add any combination of M8,08 and Q8 that
have quot;Aprilquot; next to them. So the formula checks to see if it should add all
three, or two, or just one. In this example, the returned result should be
$300.
I keep getting an error. Any help?
=IF(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,IF(R8=quot;Aprilquot;,(M8 O8 Q8),if(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,(M8 O8),(IF(N8=quot;Ap rilquot;,IF(R8=quot;Aprilquot;,((M8 Q8),IF(N8=quot;Aprilquot;,M8,IF(P8 =quot;Aprilquot;,o8,IF(R8=quot;Aprilquot;,Q8,0),0),0),0),0),0),0), 0),0),0),0),0)
You may use a simpler formula like:
=if(N8=quot;Aprilquot;,M8,0) if(P8=quot;Aprilquot;,O8,0) if(R8=quot;Ap rilquot;,Q8,0)
quot;Brandoniquot; wrote:
gt; I have six columns next to each other and am trying to add date based on the
gt; month in every other column.
gt;
gt; M8 N8 O8 P8 Q8 R8
gt; $200 April $100 May $100 April
gt;
gt; Then trying to have the formula add any combination of M8,08 and Q8 that
gt; have quot;Aprilquot; next to them. So the formula checks to see if it should add all
gt; three, or two, or just one. In this example, the returned result should be
gt; $300.
gt;
gt; I keep getting an error. Any help?
gt;
gt; =IF(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,IF(R8=quot;Aprilquot;,(M8 O8 Q8),if(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,(M8 O8),(IF(N8=quot;Ap rilquot;,IF(R8=quot;Aprilquot;,((M8 Q8),IF(N8=quot;Aprilquot;,M8,IF(P8 =quot;Aprilquot;,o8,IF(R8=quot;Aprilquot;,Q8,0),0),0),0),0),0),0), 0),0),0),0),0)
Try this one:
=M8*(N8=quot;Aprilquot;) O8*(P8=quot;Aprilquot;) Q8*(R8=quot;Aprilquot;)
The answer to your question is you probably have too many nested Ifs (only 7
are allowed.) A quick glance at it indicates you do.
--
Kevin Vaughnquot;Brandoniquot; wrote:
gt; I have six columns next to each other and am trying to add date based on the
gt; month in every other column.
gt;
gt; M8 N8 O8 P8 Q8 R8
gt; $200 April $100 May $100 April
gt;
gt; Then trying to have the formula add any combination of M8,08 and Q8 that
gt; have quot;Aprilquot; next to them. So the formula checks to see if it should add all
gt; three, or two, or just one. In this example, the returned result should be
gt; $300.
gt;
gt; I keep getting an error. Any help?
gt;
gt; =IF(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,IF(R8=quot;Aprilquot;,(M8 O8 Q8),if(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,(M8 O8),(IF(N8=quot;Ap rilquot;,IF(R8=quot;Aprilquot;,((M8 Q8),IF(N8=quot;Aprilquot;,M8,IF(P8 =quot;Aprilquot;,o8,IF(R8=quot;Aprilquot;,Q8,0),0),0),0),0),0),0), 0),0),0),0),0)
for this simple example, a simple solution
=IF(B2=quot;Aprilquot;,A2) IF(D2=quot;Aprilquot;,D2) IF(F2=quot;Aprilquot; ,E2)
--
Don Guillett
SalesAid Software
quot;Brandoniquot; gt; wrote in message
...
gt;I have six columns next to each other and am trying to add date based on
gt;the
gt; month in every other column.
gt;
gt; M8 N8 O8 P8 Q8 R8
gt; $200 April $100 May $100 April
gt;
gt; Then trying to have the formula add any combination of M8,08 and Q8 that
gt; have quot;Aprilquot; next to them. So the formula checks to see if it should add
gt; all
gt; three, or two, or just one. In this example, the returned result should
gt; be
gt; $300.
gt;
gt; I keep getting an error. Any help?
gt;
gt; =IF(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,IF(R8=quot;Aprilquot;,(M8 O8 Q8),if(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,(M8 O8),(IF(N8=quot;Ap rilquot;,IF(R8=quot;Aprilquot;,((M8 Q8),IF(N8=quot;Aprilquot;,M8,IF(P8 =quot;Aprilquot;,o8,IF(R8=quot;Aprilquot;,Q8,0),0),0),0),0),0),0), 0),0),0),0),0)
=SUMPRODUCT(SUMIF(INDIRECT({quot;N8quot;,quot;P8quot;,quot;R8quot;}),quot;Apri lquot;,INDIRECT({quot;M8quot;,quot;O8quot;,quot;Q8
quot;})))
--
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
quot;Brandoniquot; gt; wrote in message
...
gt; I have six columns next to each other and am trying to add date based on
the
gt; month in every other column.
gt;
gt; M8 N8 O8 P8 Q8 R8
gt; $200 April $100 May $100 April
gt;
gt; Then trying to have the formula add any combination of M8,08 and Q8 that
gt; have quot;Aprilquot; next to them. So the formula checks to see if it should add
all
gt; three, or two, or just one. In this example, the returned result should
be
gt; $300.
gt;
gt; I keep getting an error. Any help?
gt;
gt;
=IF(N8=quot;Aprilquot;,IF(P8=quot;Aprilquot;,IF(R8=quot;Aprilquot;,(M8 O8 Q8),if(N8=quot;Aprilquot;,IF(P8=quot;A
prilquot;,(M8 O8),(IF(N8=quot;Aprilquot;,IF(R8=quot;Aprilquot;,((M8 Q8 ),IF(N8=quot;Aprilquot;,M8,IF(P8=quot;
Aprilquot;,o8,IF(R8=quot;Aprilquot;,Q8,0),0),0),0),0),0),0),0) ,0),0),0),0)
- Jul 20 Thu 2006 20:08
Why doesn't this nested IF statement work?
close
全站熱搜
留言列表
發表留言