?
Solved

Excel Formula that factors in dates in calculating revenue

Posted on 2010-08-26
15
Medium Priority
?
897 Views
Last Modified: 2012-05-10
I need a Microsoft Excel formula that will help me calculate revenue based on a date. For example, I will have a date, say 5/21/2010, and I need to account for all days following this date until the end of the year (so, from 5/21 to 12/31) -- need to get a total count of days, like 180.  

Need a date formula that will calculate this.
0
Comment
Question by:maevemcg88
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +3
15 Comments
 
LVL 45

Accepted Solution

by:
patrickab earned 2000 total points
ID: 33532581
Use:

=DATEDIF(A1,B1,"d")

Where:

A1 contains the start date
B1 contain the end date

and "d" specifies days.

Patrick
0
 
LVL 17

Expert Comment

by:gtgloner
ID: 33532591
All you should have to do is to subtract the cell where the first date is from the cell where the second one is and change the format of the cell where the formula is to a number.
0
 
LVL 45

Expert Comment

by:patrickab
ID: 33532595
Or just use:

=B1-A1

and format the result as a number
0
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
LVL 45

Expert Comment

by:patrickab
ID: 33532599
xover...
0
 
LVL 9

Expert Comment

by:hitsdoshi1
ID: 33532664
="mm/dd/yy"-now() so for your formula will be ="12/31/10"-now()
0
 
LVL 45

Expert Comment

by:patrickab
ID: 33532689
But 5/21/2010 is not now!!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 33532729
If you have a date in A1 this will count the number of days until the end of that year.....including that date
=DATE(YEAR(A1)+1,1,1)-A1
format result cell as general
regards, barry
0
 
LVL 18

Expert Comment

by:Cluskitt
ID: 33532818
=DATEDIF(A1,B1,"d")*C1
A1 is start date, B1 is end date, C1 is revenue
Very similar to Patrick's, so if you do like this answer, give the points to him. :)
0
 

Author Comment

by:maevemcg88
ID: 33533137
I don't have to columns with dates -- its just the end of the year, so I guess it would be 12/31. Should I make a column that is 12/31 and then use the formula =DATEDIF(A1,B1,"d")?
0
 
LVL 18

Expert Comment

by:Cluskitt
ID: 33533212
You can just put the value there:
DATEDIF(A1,"12/31/10","d")
I'm assuming your regional date setting are mm/dd, and not dd/mm
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 33533216
If you use the formula I suggested above then you can get the result you need (number of days until the end of the year) with just a single date, i.e. with date in A1
=DATE(YEAR(A1)+1,1,1)-A1
format result cell as general
regards, barry
 
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 33533664
....note, if the date in A1 is 30th December (of any year) then the formula O suggested will give a result of 2 (because it counts the 30th and 31st). Of you want a result of 1 for that example then change formula slightly as follows:

=DATE(YEAR(A1),1,0)-A1

Either formule will give you the number of days until the end of that year, irrespective of the year of the date

Regards, barry
0
 

Author Comment

by:maevemcg88
ID: 33534053
Great, the formula worked. Thank you all.

My next question is... once I have this value how do I subtract it from a YEAR. I tried subtracting it simply from 365 but is there any more accurate way to subtract a number of days from a year? Simple question, appreciate any answer. THANKS.
0
 
LVL 45

Expert Comment

by:patrickab
ID: 33534119
You can still use:

=DATEDIF(01/01/2010,31/12/2010,"d") to find out the number of days in the year

or you could use:

=If(int(year(date)/4)=year(date), 366, 365)

for leap years and non-leap years

Patrick
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 33534667
Wouldn't subtracting the number of days left in the year from the number of days in the year be the same as counting from the start of the year to your date?
For that try
=A1-DATE(YEAR(A1),1,1)
That will be the equivalent of subtracting the previous result from 365.....or 366 if the year is a leap year
regards, barry
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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