Solved

Provide a month to date total based on the day of the month

Posted on 2011-03-01
13
834 Views
Last Modified: 2012-05-11
Hi team,

I'm developing a spreadsheet to provide a sum of income & expenses for the month to date, where the table has income/expenses budgeted by days across in columns and the line detail down in rows.

There is a description in column D, a budget figure for the whole month in column E, with the monthtodate value for that row in column F and days 1 to 31 in subsequent columns, where each days values are entered.    

On day 1 the spreadsheet table will show all the figures as budgets and if you sum the MTD totals (horizontally) this will show the same value as the budget column.   However the MTD column will only show the value of day1 for each row.

On day 2 the MTD column will now show the sum of days 1 to 2 for the row in question.

Row 2 holds the Day number for the month
 
I have got so far in the formula in cell

=IF(TEXT(DAY(NOW()),0)<=G2,G5,SUM(G5:H5))

How do I reference the sum(G5:AK5) in each cell on row 5 to reflect the sum according to the day of the month?

Cheers
Bernard  

0
Comment
Question by:BernardGBailey
  • 6
  • 3
  • 2
  • +2
13 Comments
 
LVL 10

Expert Comment

by:Makrini
ID: 35015005
Can you provide a sample?  I am almost understanding what you are asking for, but if you provide a spreadsheet example can do it for you quicker
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 35015128
Hello,

You can use Index() of the range G5:AK5 with the number of today's date:

=IF(TEXT(DAY(NOW()),0)<=G2,G5,SUM(G5:INDEX(G5:AK5,DAY(NOW()))))

cheers, teylyn
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 35015146
Just an observation (This has nothing to do with the Sum.)

I'm a bit puzzled by the condition in your IF statement.  It only seems curious that you convert a number to text, and then use a <= comparison. Is there a text value in G2?

But I assume the formula you posted works in your workbook, so I'll leave that part alone.

cheers, teylyn
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 45

Expert Comment

by:patrickab
ID: 35015699
BernardGBailey,

Please upload your file.

Patrick
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 35015734
I agree that you should best upload your file.

Reviewing your post, I believe you could use this:

>>Row 2 holds the Day number for the month

If row 2 holds a number, change the formula thus, starting in :

=IF(DAY(NOW())<=G2,G5,SUM(G5:INDEX(G5:AK5,DAY(NOW()))))

What is still not clear is whether you want to have this formula in only one cell or whether you want a documented trail of MTD numbers. In order to give you the correct formula for more than one cell, we'd need to see your data layout, so the cell references can be adjusted accordingly.

cheers, teylyn
0
 
LVL 45

Expert Comment

by:patrickab
ID: 35016840
BernardGBailey,

How do I reference the sum(G5:AK5) in each cell on row 5 to reflect the sum according to the day of the month?

Try this for MTD summation

=Sumproduct((G2:AK2)<=day(today())*G5:AK5)

Patrick
0
 

Author Comment

by:BernardGBailey
ID: 35021543
Sorry about the delay in getting back to this


Microsoft-Excel---Cash-Position-.png
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 35021711
Hello,

in F4 and copied down

=SUM(G4:INDEX(G4:AK4,DAY(TODAY())))

or, adjusting Patrick's suggestion so it can be copied down:

=Sumproduct(($G$2:$AK$2)<=day(today())*G4:AK4)

This assumes that the values in G2:AK2 are numbers.

cheers, teylyn
0
 

Author Comment

by:BernardGBailey
ID: 35021790
Further notes, since it is the 3rd of March the MTD column does not include the Deposit of 4th March, yet it does include the Vege Co-Op $12 from the 3rd of March.

The current formula is =IF(TEXT(DAY(NOW()),0)<=G$1,G4,SUM(G4:I4))

If I don't use the TEXT function I get an error.
0
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst earned 500 total points
ID: 35021911
Hello,

the Sum formula from my post above produces the correct results.

=SUM(G4:INDEX(G4:AK4,DAY(TODAY())))

The Sumproduct needs a little adjustment with the brackets, and then does so, too.

=SUMPRODUCT(($G$2:$AK$2<=DAY(TODAY()))*G4:AK4)

Enter the formula of your choice into F4, then copy down.

cheers, teylyn
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 35021919
Your values in row 2 seem to be text, or numbers formatted as text.  But that does not matter if you use

=SUM(G4:INDEX(G4:AK4,DAY(TODAY())))
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35022027
Not for Points

If row 2 contains numbers then SUMIF would be a better option than SUMPRODUCT (in my opinion) but if they are text values you could modify Patrick's (and teylyn's) SUMPRODUCT suggestion to work for you....

=SUMPRODUCT((G$2:AK$2+0<=DAY(TODAY()))+0,G4:AK4)

regards, barry
0
 

Author Closing Comment

by:BernardGBailey
ID: 35022104
teylyn,
Thanks for your solution, I removed the if-then-else since it is not needed.

Many thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 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