#1   Report Post  
Channing
 
Posts: n/a
Default 7+ Nest If's

I need to nest over 7 IF statements and didn't find the answer I needed in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.
  #2   Report Post  
Jimbola
 
Posts: n/a
Default

INsteda of using IF statements you may want to consider a sumif function. Eg.

a b c d e f
1 Month June
2 January February March April May June
3 100 200 300 400 500 600

=SUMIF(A2:F2,"<="&B1,A3:F3)

The formula totals all the figures if the months in row 2 equals or is less
than June in B1. But you need to use full month names. If your set-up is
different or you are using names, re-post with more details.

Hope that helps.

Jimbola


"Channing" wrote:

I need to nest over 7 IF statements and didn't find the answer I needed in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.

  #3   Report Post  
Tim C
 
Posts: n/a
Default

With your budget in C1:C12 and the current month in A1,

If the current month is a number:

=SUM(OFFSET(C1,0,0,A1))

If the current month is a date:

=SUM(OFFSET(C1,0,0,MONTH(A1)))

If the current month is the name of a month:

=SUM(OFFSET(C1,0,0,MONTH(A1&" 1")))

If your budget is in a row instead of a column, take out one of the "0," for
example:

=SUM(OFFSET(C1,0,A1))

Tim C

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I needed in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.



  #4   Report Post  
Tim C
 
Posts: n/a
Default

That last part is backwards. If your budget is in a row instead of a
column, ADD an additional comma, for example:

=SUM(OFFSET(C1,0,0,,A1))

Tim C

"Tim C" wrote in message
...
With your budget in C1:C12 and the current month in A1,

If the current month is a number:

=SUM(OFFSET(C1,0,0,A1))

If the current month is a date:

=SUM(OFFSET(C1,0,0,MONTH(A1)))

If the current month is the name of a month:

=SUM(OFFSET(C1,0,0,MONTH(A1&" 1")))

If your budget is in a row instead of a column, take out one of the "0,"
for example:

=SUM(OFFSET(C1,0,A1))

Tim C

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I needed in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.





  #5   Report Post  
KL
 
Posts: n/a
Default

Hi Channing,

How about this:

=SUM(INDIRECT("Jan:" & A1))

Regards,
KL

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I needed in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.





  #6   Report Post  
KL
 
Posts: n/a
Default

Sorry, this won't work.

KL

"KL" wrote in message
...
Hi Channing,

How about this:

=SUM(INDIRECT("Jan:" & A1))

Regards,
KL

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I needed in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.





  #7   Report Post  
Myrna Larson
 
Posts: n/a
Default

Why does it not work? Your original post implies that you have named the
ranges for each month. Is that not correct?


On Sat, 22 Jan 2005 10:22:55 +0100, "KL"
wrote:

Sorry, this won't work.

KL

"KL" wrote in message
...
Hi Channing,

How about this:

=SUM(INDIRECT("Jan:" & A1))

Regards,
KL

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I needed in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.





  #8   Report Post  
KL
 
Posts: n/a
Default

Hi Myrna,

I assumed the OP did InsertNameCreateTop Row. Curiously, if I do
=SUM(Jan:Mar) it works, but my suggested =SUM(INDIRECT("Jan:" & A1)) seems
to only return Jan not the whole range. Must be something about INDIRECT (I
seem to recall having read something about it, but not sure).

Regards,
KL



"Myrna Larson" wrote in message
...
Why does it not work? Your original post implies that you have named the
ranges for each month. Is that not correct?


On Sat, 22 Jan 2005 10:22:55 +0100, "KL"

wrote:

Sorry, this won't work.

KL

"KL" wrote in message
...
Hi Channing,

How about this:

=SUM(INDIRECT("Jan:" & A1))

Regards,
KL

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I needed
in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.






  #9   Report Post  
Myrna Larson
 
Posts: n/a
Default

You're right, it doesn't work. I don't know why -- I think it should. But this
variation does:

=SUM(Jan:INDIRECT(A1))


On Sat, 22 Jan 2005 19:45:22 +0100, "KL"
wrote:

Hi Myrna,

I assumed the OP did InsertNameCreateTop Row. Curiously, if I do
=SUM(Jan:Mar) it works, but my suggested =SUM(INDIRECT("Jan:" & A1)) seems
to only return Jan not the whole range. Must be something about INDIRECT (I
seem to recall having read something about it, but not sure).

Regards,
KL



"Myrna Larson" wrote in message
.. .
Why does it not work? Your original post implies that you have named the
ranges for each month. Is that not correct?


On Sat, 22 Jan 2005 10:22:55 +0100, "KL"

wrote:

Sorry, this won't work.

KL

"KL" wrote in message
...
Hi Channing,

How about this:

=SUM(INDIRECT("Jan:" & A1))

Regards,
KL

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I needed
in
the other posts. I need to check the month in cell a1 for the month to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if a1="June",
sum(Jan:June).

Thanks for the help.






  #10   Report Post  
KL
 
Posts: n/a
Default

Gosh! I've tried all variations but this one. Thanks a bunch.

KL

"Myrna Larson" wrote in message
...
You're right, it doesn't work. I don't know why -- I think it should. But
this
variation does:

=SUM(Jan:INDIRECT(A1))


On Sat, 22 Jan 2005 19:45:22 +0100, "KL"

wrote:

Hi Myrna,

I assumed the OP did InsertNameCreateTop Row. Curiously, if I do
=SUM(Jan:Mar) it works, but my suggested =SUM(INDIRECT("Jan:" & A1)) seems
to only return Jan not the whole range. Must be something about INDIRECT
(I
seem to recall having read something about it, but not sure).

Regards,
KL



"Myrna Larson" wrote in message
. ..
Why does it not work? Your original post implies that you have named the
ranges for each month. Is that not correct?


On Sat, 22 Jan 2005 10:22:55 +0100, "KL"

wrote:

Sorry, this won't work.

KL

"KL" wrote in message
.. .
Hi Channing,

How about this:

=SUM(INDIRECT("Jan:" & A1))

Regards,
KL

"Channing" wrote in message
...
I need to nest over 7 IF statements and didn't find the answer I
needed
in
the other posts. I need to check the month in cell a1 for the month
to
determine the YTD Budget. IE if a1= "May", sum(Jan:May),if
a1="June",
sum(Jan:June).

Thanks for the help.








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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I nest more than seven functions in MS Excel? DMB Excel Worksheet Functions 3 January 9th 05 04:47 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM
How do I nest an OR function within an AND function? DebbieK Excel Worksheet Functions 3 November 30th 04 06:03 PM
double lookup, nest, or macro? Josef.angel Excel Worksheet Functions 1 October 29th 04 09:50 AM


All times are GMT +1. The time now is 11:02 AM.

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

About Us

"It's about Microsoft Excel"