+ Reply to Thread
Results 1 to 21 of 21

Calculate an average daily expense cell

  1. #1
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Calculate an average daily expense cell

    Hi guys! First post and I'm pretty much a complete noob at Excel. I've set up a simple spreadsheet to keep track of my food expenses every month. The first column is for the date, the second is for the daily total expenses and then the next three columns are where I add the data which is then calculated into the daily total column.

    I also have a total at the bottom for the entire month. Now what I want to do is I want to also have underneath the grand total, a cell which keeps track of my average daily expenses. Basically I want to divide the total expenses by the number of days which I've entered data. Now normally this would be fine but because I've applied the formula to all the cells in the expense column, it automatically lists every day as "0" rather than leaving it blank. So when it does the average calculation it's dividing my total by 30 days rather than by only the 7 days I have data for.

    I suppose I could remove the formula =SUM(C1:E1) but that would mean that I would have to add up my expenses that day by myself and I'd rather let the program do it for me.

    Can anyone help me out here?
    Last edited by Canuck_in_Japan; 02-08-2009 at 02:09 AM.

  2. #2
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: Calculate an average daily expense cell

    Hi

    I assume you are using COUNTA for your formula, instead try
    Please Login or Register  to view this content.
    .

    Regards

    Jeff

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculate an average daily expense cell

    Hi, and welcome to the forum

    Can I suggest you put the total and average formulae above the data. That way you never have to worry about data encroaching on the total. It doesn't matter so much in this example, but experience tells me that with mpre complex applications, where you are perhaps copying data in from other sheets, this can trip you up.

    Anyway, back to the plot. Assuming your daily totals start in B10, for the average use:

    Please Login or Register  to view this content.
    Adjust ranges to suit.

    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Hi guys. Thanks for your help. Please believe me I'm a complete noob so things like COUNTA and COUNTIF mean nothing to me I think what you're suggesting is to put in a formula that only counts the entry if it is larger than "0". (I could be completely wrong on this). I actually do want to include the "0" entries. For example if I buy nothing on a particular day I want my expense/day to drop. The problem is that my whole range for the month is already filled in with zeros so right now my daily expenses is listed at 240 yen per day when actually it's well over 1000. So by the end of the month my expense average will be accurate but the rest of the month will be completely inaccurate.

    Is there any way that I can have a formula that calculates the sub-totals for the day but have it leave the cell blank until I've actually entered some data?

    And again, you may have already pointed me in the right direction but I'm too dim to realize it. Please be patient with me

  5. #5
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Just thinking some more, I suppose I could switch the days that I don't spend any money to have a value of 1 (one yen is practically nothing!) and that would be almost the same.

  6. #6
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Well I tried what you suggested Richard and my idea of just putting one into the column and it seems to work fine. It still seems slightly dirty to me-there must be a better solution but I guess in the grand scheme of things, realistically there will be extremely FEW days where I spend no money on food and for those few days, one yen out of 25-30,000 yen in a month won't make much of a difference.

    So I guess I'll live with it! Thanks very much for the help guys. If there is another solution I would still be interested in hearing it, just out of curiosity sake.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Calculate an average daily expense cell

    if you want to average counting days when you spend 0
    =SUM(B10:B100)/COUNTIF(B10:B100,">=0")
    but you must enter 0 in cell

  8. #8
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Yes but the problem is that all the cells automatically have 0 entered in that range because I copy and pasted =SUM(C1:E1) for all of the days in the month. So even though it's only Feb 7th, the entire range has 0 in the expense column for each particular date. I could erase that formula and just have a blank cell but then I would automatically be adding up my day's expenses and inputting them rather than having the program do the calculation for me. Until I can get a better solution I guess I'll just keep it so that it calculates >0 and put in a "1" for the days that I don't spend anything to keep the average accurate.

  9. #9
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    I just made up a quick example. I'm actually using office mobile on my PDA and this is Open office but it's pretty much the same

    So you can see that since I've copy and pasted the formula =SUM(C1:E1) (which adds all the subtotals for me) through the entire range of 1 month, it has automatically made everything in that range 0 even though I haven't actually entered data for those other days yet. For the average in this example I just did a simple =AVERAGE(B1:B31) . Now if the days that haven't occurred yet had no data then this would be fine as I believe (I don't actually know) that excel would only count the days which have some data. But you can see that it has counted all the days of the month and so my daily average expenses are only 160 yen per day when actually it should be well above 1000. Now I've managed to get around that by making the numbers counted greater than zero and adding a "1" for the days I don't spend money, but surely there's a better way.

    http://i59.photobucket.com/albums/g2...r907/excel.jpg

    Oops it appears I can't post images on this forum. Well that is an image of the example I made up.

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculate an average daily expense cell

    Hi,

    Have you actually tried the formula I gave you? With the data in the picture you pasted, (please note for future reference you should upload a workbook rather then a picture - see the recommendations on the forum rules), I get the answer 1275.25 which is the average of the four amounts divided by 4 - the number of non zero entries.

    Rgds

  11. #11
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Calculate an average daily expense cell

    hi,

    I agree with Richard, can you please post a workbook?

    I'm not sure if I'm on the right track here...
    Have a look at the attached file (copy your data in etc) & see if it gives the results you expect.

    I have set this up using a dynamic resizing range, "MTD" (="Month To Date") which is relative to each column & adjusts the range to include upto the current day of the month.

    hth
    Rob
    Attached Files Attached Files
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Calculate an average daily expense cell

    well i read it that he does want to count 0 entries , for dates passed so
    say mon 3 ,tue 0 ,wed 0,thur 5 the average is 2 not 4
    simply replace in b =SUM(C1:E1))
    with
    =IF(A1>TODAY(),"",SUM(C1:E1)) then you only get historical zeros which can be counted
    Last edited by martindwilson; 02-07-2009 at 07:25 AM.

  13. #13
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculate an average daily expense cell

    Hi Martin,

    Must admit that wasn't my reading when he entered in his original post, "Basically I want to divide the total expenses by the number of days which I've entered data."

    Had he wanted all past days even if zero presumably he would have said, "divide by the number of days to date"?


    Maybe he will clarify.

    Rgds

  14. #14
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Calculate an average daily expense cell

    Quote Originally Posted by martindwilson View Post
    ...=IF(A1>TODAY(),"",SUM(C1:E1)) then you only get historical zeros which can be counted
    Martin, the calculation loading in this file is not likely to be high, esp if the OP only puts one month's expenses into each file but I think it would still be of benefit/better practice to insert the volatile "today()" function in a separate cell & have each formula refer to that. See Dave's comments about Volatile functions 1/2 way down the linked sheet:
    http://www.ozgrid.com/News/GoodVsBad...edUpEvents.htm

    Hopefully the OP can clarify the rest...

    hth
    Rob

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Calculate an average daily expense cell

    agreed ,buts its hardly going to affect a simple one sheet expenses log.
    then again broro i never noticed the formula i was suggesting was a mod to your sheet ,which is fine,
    i thought it was op's and just looked at it quickly to see which col held dates!
    Last edited by martindwilson; 02-07-2009 at 03:34 PM.

  16. #16
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Hi guys, thank you for your continuing interest in this thread. I'm going to upload a workbook now. On my PDA (which has Excel Mobile) your formula worked fine Richard but for some reason when I try to replicate it on Open Office I can't get it to work! So my average total just has a simple =AVERAGE(Bx:Bx). Yes I do want to count the zero's but only for the dates that have already passed. What I wish is that the zero's would not be there in the first place. If there is a day when I don't spend any money then I will manually put "0" into the cell. What I would like for my expense column is something like

    Please Login or Register  to view this content.
    And broro, wow. I described my spreadsheet as "simple" but after looking at yours I see I was being WAY too generous. Mine is stone age!
    Attached Files Attached Files

  17. #17
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculate an average daily expense cell

    Hi,

    Well how about:

    Please Login or Register  to view this content.
    HTH

  18. #18
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Also just to clarify, I want historical 0's to be counted not future ones. Also, will excel be able to tell whether or not that day has occurred already? Again, if excel would simply just not enter any numbers into the expense column until I have actually entered some data then I would have no problem.

  19. #19
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Thanks Richard-I'll give that a shot later today.

  20. #20
    Registered User
    Join Date
    02-06-2009
    Location
    Japan
    MS-Off Ver
    Excel Mobile
    Posts
    10

    Re: Calculate an average daily expense cell

    Yes that worked brilliantly! I no longer have zeros in my expense column and now I can calculate the average using the simple average formula. That's exactly what I wanted. If only I could have explained myself better from the beginning. Thanks for your help guys.

  21. #21
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Calculate an average daily expense cell

    OK, glad to help.

    When you get a moment will you go back to the original post and mark it SOLVED.

    Many thanks

+ 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