• Welcome to the Off-Topic/Schweb's Lounge

    In addition to the Mac-Forums Community Guidelines, there are a few things you should pay attention to while in The Lounge.

    Lounge Rules
    • If your post belongs in a different forum, please post it there.
    • While this area is for off-topic conversations, that doesn't mean that every conversation will be permitted. The moderators will, at their sole discretion, close or delete any threads which do not serve a beneficial purpose to the community.

    Understand that while The Lounge is here as a place to relax and discuss random topics, that doesn't mean we will allow any topic. Topics which are inflammatory, hurtful, or otherwise clash with our Mac-Forums Community Guidelines will be removed.

Excel Question

Joined
Jul 4, 2008
Messages
73
Reaction score
0
Points
6
Location
Sapporo, Japan
Your Mac's Specs
mid-2010 15" MacBook Pro 2.8 i7, 8GB, OS X 10.6.8
Maybe some excel gurus can help me out here, or maybe just someone who's not retarded like me.

I have an excel worksheet that list my store's daily totals for the month.
I want to get an figure to show me what I average, per day, for the current month. Easy except that if the month isn't over I don't want it to average the days that haven't happened yet.

Example: cells A1 to A31 have a dollar figure for each day of the month (1-31).
If I do just a regular average formula it will look like this: =AVERAGE(A1:A31), this will add up all the totals and divide it by 31.
My dilemma is this, take today, it's December 26th, so to get the daily average it should divide the total sales by 26 in order to get the real time average, but with the regular formula it will always divide by the total number of days in the month, rather than only just the days that have elapsed.

Thanks for the help.
 
Joined
Sep 2, 2006
Messages
400
Reaction score
11
Points
18
Location
London, England
Your Mac's Specs
iMac Pro 2017 3GHz 10-core 128GB RAM MacBook Pro 13-inch 2.3GHz i5 16GB RAM
There is probably a more elegant solution to this, but I would make a new column where the cells next to your daily total has a IF-condition that says if your total for the day is larger than zero, then show 1.

If you then are on day 26, you will have 26 cells with a 1 in them. To get the average for the month so far, use the sum of the full range of the new cells to divide with and you will always use the number of days for which you have entered a total.

Is it a bit difficult to describe in writing like this, but it will work so just ask if anything is unclear.
 
Joined
Nov 18, 2006
Messages
4,934
Reaction score
207
Points
63
Location
Anytown, USA
Your Mac's Specs
27" iMac 2.7GHz Core i5, iPhone 6, iPad Air 2, 4th gen Apple TV
If the cells have nothing in them, it should only average the cells that have amounts in them. So even though you have 31 cells selected, Excel will only average the 26 that have amounts in them and will include the next days day and total when you enter it in. So, it would probably be easiest to leave the cells representing days in the future with no sales completely blank instead of with a $0 so Excel won't count them.
 
OP
C
Joined
Jul 4, 2008
Messages
73
Reaction score
0
Points
6
Location
Sapporo, Japan
Your Mac's Specs
mid-2010 15" MacBook Pro 2.8 i7, 8GB, OS X 10.6.8
That worked, thanks. I knew that it had to be something simple.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top