Solved

Offset sum

Posted on 2014-12-02
12
111 Views
Last Modified: 2014-12-02
So I have to sum a column with dates Jan-Dec.

But I only sum to the last month, so today I would sum all the numbers in rows Jan-Nov - there is data in all cells Jan-Dec

Currently we manually adjust the formula, is there any way I could automatically sum the correct range by using offset or by instructing of the current month?

Thanks
0
Comment
Question by:Seamus2626
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 167 total points
ID: 40475400
Could you send a dummy?
0
 
LVL 5

Assisted Solution

by:Hakan Yılmaz
Hakan Yılmaz earned 167 total points
ID: 40475403
You can use SumIf formula like this.
=SumIf(DateRange,"<="&Today(),SumRange)
You can change "Today()" with a fixed cell refence which has the latest date you want to sum.

I don't suggest but you can use whole columns while defining DateRange and SumRange.
Like =SumIf(A:A,"<"&Today(),B:B).

It is better to define a table, and use table columns as reference ranges. It will be a lot faster.
You can look here for information about creating and deleting tables
0
 
LVL 18

Expert Comment

by:SimonAdept
ID: 40475410
To sum a column of figures in B with dates in A up to the last day of the previous month...

=SUMIF(A:A,"<" & TODAY()-DAY(NOW()),B:B)
0
 

Author Comment

by:Seamus2626
ID: 40475417
Attached
EE.xlsx
0
 
LVL 5

Expert Comment

by:Hakan Yılmaz
ID: 40475440
I changed formulas in your sheet in the file attached.

I suggest you to define a table and record values only from top to bottom. And then you can use pivot tables to see reports easily.
EE.xlsx
0
 

Author Comment

by:Seamus2626
ID: 40475442
My sum needs to be in the same column, so I am summing k4-k15 in k17

I have a reference cell which gives the correct reporting month - so in k20 I have today()-31 which gives me Nov-14

So =SUMIF(A:A,"<" & TODAY()-DAY(NOW()),B:B)  is turned to =SUMIF(J4:J15,"=" & J20,K4:K15)

Where J20 = Nov-14
J4-J15 is Jan-Dec & K4-K15 are the numbers

Thanks
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 18

Assisted Solution

by:SimonAdept
SimonAdept earned 83 total points
ID: 40475445
Please see attached solution.
EE-SumToPrevMonth.xlsx
0
 
LVL 5

Assisted Solution

by:Hakan Yılmaz
Hakan Yılmaz earned 167 total points
ID: 40475453
Excel doesn't keeps dates as months in cell values. It treats all dates as "days". So you have exactly defined 1 day in cell J20 which is 31 days ago. If you want the latest day of past month, it is =DATE(YEAR(TODAY());MONTH(TODAY());0). The file i sent was summing in the same column with data.
0
 
LVL 48

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 167 total points
ID: 40475482
HI,

pls try

=SUM(OFFSET(B2,0,0,MONTH($B$16),1))

Regards
0
 

Author Comment

by:Seamus2626
ID: 40475533
Have look at the attached guys, doesn't seem to work for me - K16 is not calculating
Copy-of-EE-SumToPrevMonth.xlsx
0
 
LVL 5

Expert Comment

by:Hakan Yılmaz
ID: 40475570
Corrected months column. This column should have actual date values and be formatted same as reporting month.
Copy-of-EE-SumToPrevMonth-rev.xlsx
0
 
LVL 31

Assisted Solution

by:Rob Henson
Rob Henson earned 83 total points
ID: 40475782
Alternative to get last day of previous month:

=EOMONTH(TODAY(),-1)

Thanks
Rob H
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now