Date serial to real number

JoeSalmi

Board Regular
Joined
Jan 31, 2011
Messages
128
I have a formula in which I am asking for the number of days in a month to be printed in B3 but when I try to do math from the # of days it gives me the date serial number instead. Can I get some help please.

In cell A1 I have the date 1/1/2011 formatted as "yyyy"
In cell A2 I have =DATE(YEAR($A$1),"1","1") formatted as "mm"
In cell B2 I have =IF(NOW()>=A2,IF(MONTH(NOW())=MONTH(A2), DAY(NOW()),EOMONTH(A2,0)),"") formatted as "dd"

Now in another sheet I have math going on but for the sake of this post lets just say that my math is now in cells H5:H16
using this formula: =IF(I5="Y",B2-1,"")
(now what this is saying it that if my tenant is late on rent I want to it to multiply the late charge (in cell H2 ($5))by the number of days that have pasted minus 1 day.

So for example January has 31 days. Rent is due on the first however everyday after the 1st a $5 late fee is accumulated. So in cell H5 it displays the number of days they are late. In this case it is 30 days. However if you do the format to a number it shows me 40573 instead of 30. So when I try to multiply the number of days they are late by the late fee it gives me $1,646,208,902.00

Seems my tenants might be a little upset by this so I was wondering if anyone could give me a hand.
 
Thanks for the tip Rick!

Joe, maybe it would help if you just tell us what you need to do without using the formulas that you are already using. For example, "I want cell B1 to tell me the difference between today's date and the last day of last month" or whatever . . . maybe it's just too late tonight for me to wrap my brain around it but sometimes it helps to state it more simply without using the formulas in your explanation. Slink

I understand that.

What I want to do is calculate the number of days my tenant is late on rent. My lease agreement states that rent is due on the first and for everyday after the 1st there is a $5 charge. I want to calculate the current amount due at the time I open the spreadsheet. I don't want to have to enter in anything other then a "y" to state that their rent is late.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I want to convert the serial number of a day to a number such as the current number of days passed or present
October is passed so it would tell me 31 but with the same formula I want it to tell me that today is the 9th
I'm not sure about anyone else, but this is still not clear to me. Here is a suggestion that I think will help... pick out 5 or more typical values that cover a representative range of dates and show them to us along with the result you would like the formula to produce for them. That way we can better see what you are trying to describe to us in words.
 
Upvote 0
Try replacing the formula you have in H14 with this...

=H2*DAY(--the formula you currently have in H14 goes here, without the equal sign, of course--)
 
Upvote 0
#NAME?
I see what your trying to do though.
Telling us you got a #NAME? error doesn't really tell us anything. Copy/paste the formula that gives you that error into a response message here so we can see what you attempted to do.
 
Upvote 0
Hi again Joe,
The picture and the download really helped - I am playing with it but no answer yet, we'll keep plugging away though! Interesting problem!! Slink
 
Upvote 0
Wait a minute!!! Rick already had the answer - using his suggestion, put
=H$2*DAY(IF(I14="Y",B11-1,""))
into cell H14.
That works for me in your downloaded sheet Joe, the result in H14 is $150.
It even works for November when you fill down. Great job Rick!!!
 
Last edited:
Upvote 0
Wait a minute!!! Rick already had the answer - using his suggestion, put
=H$2*DAY(IF(I14="Y",B11-1,""))
into cell H14.
That works for me in your downloaded sheet Joe, the result in H14 is $150.
It even works for November when you fill down. Great job Rick!!!



You're right it does work. However I needed to change it up some. I ended up with this formula

=H$2*DAY(B11)-1

Of course I did a ton of other moving things around but I did get it... Thanks to all the help guys.
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,721
Members
449,465
Latest member
TAKLAM

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top