+ Reply to Thread
Results 1 to 5 of 5

If statement to add cells based on months.

  1. #1
    Registered User
    Join Date
    11-09-2009
    Location
    NJ
    MS-Off Ver
    Excel 2003
    Posts
    91

    If statement to add cells based on months.

    I was hoping someone could help me with this. I am trying to put in an If statement or a formula where the sum of the 2008 months would be added automatically based on the current month of the current year. So I would just want the sum for Jan 2008 - Oct 2008. The Months are a count field based on 2009.

    I do not have a clue if there is a function out there that I can use that would suit my needs or make manual changes ongoing.



    2008 2009 Dev. %
    Calendar month 10 Months
    JAN 200 220 -9%
    FEB 150 150 -12%
    MAR 125 160 -13%
    APR 130 145 -17%
    MAY 154 158 -20%
    JUN 160 130 -24%
    JUL 160 123 -25%
    AUG 150 154 -26%
    SEP 120 168 -34%
    OCT 110 147 -59%
    NOV 100
    DEC 150


    any help would be appreciated.
    Last edited by jsohng; 11-09-2009 at 12:05 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If statement to add cells based on months.

    1) What is the formula you're using for the % calc in column D?

    2) You can create formula that accumulates values from the rows above as it is copied down. For instance:
    =SUM($B$3:$B3) / SUM($C$3:$C3)

    Notice all the references are locked except the last row reference. As this is coped down, each row sums one row more than the previous row did. Perhaps this will help you?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-09-2009
    Location
    NJ
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: If statement to add cells based on months.

    =COUNT(C3:C14) is the formula in column D for months

    =SUM($C3:C$54)/SUM($B3:B$54)-1 is the formula for calculating deviations.


    And what I am trying to get is the sum for 2008.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If statement to add cells based on months.

    Might be an idea to post a sample so we can see the layout - quite hard to visualise. If you have 12 months I'm curious as to the 3:54 row range ?

    Based on your initial post, perhaps (?) you want:

    =SUM(B3:INDEX(B3:B14,COUNT(C3:C14)))

  5. #5
    Registered User
    Join Date
    11-09-2009
    Location
    NJ
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: If statement to add cells based on months.

    That worked! Thanks alot. Sorry if i was not too clear or didn't put enough info up.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1