TODAY() function not working in Microsoft Excel - excel

I want to calculate the number of days that have elapsed from the start date. For that I am using the function =TODAY()-C3. You can see in the image that C3 contains the start date. But the answer is coming "03-Jan-00". If I just write =TODAY() or =TODAY()+5 it is working. I am attaching the screenshot and a google drive link where you can see the screen recording of the problem for a better understanding.
https://drive.google.com/file/d/1lQ7djK1BRICjFfAaAG0T08snuRZhcU-k/view?usp=share_link

Works as shown:
Just note that cell c1 is formatted as number.
The reason that you need to format as a number is because that is the result you expect. ie the difference between two dates is a number of days, not a day with month and year.

Related

Salary Calculation in Excel

So I have a problem that I'm dealing with for days now and I cant figure it out. I have this problem in excel, I am looking for assistance regarding a calculation. I want to be able to calculate a payment date schedule based on a set monthly payment date but to exclude exclude weekends and specific holiday dates e.g.
Here's My file I'm Working on:[].
Here is some function that I already used : =IF(TEXT(O2,"dddd")=$U$2,O2+2,IF(TEXT(O2,"dddd")=$U$3,O2+1,O2))This works for only weekends, It doesn't work on holidays, I want it to work not only on weekends and on holidays too.
Thanks in advance.
This can be done by using the WORKDAY() function together with the DATE() function.
B2 contains year - 2012
B3 contains payment day - 28
A5:A17 contain payment periods (month numbers) - 1..12
D6:D16 contain holidays
=WORKDAY(DATE($B$2,A6,$B$3-1),1,$D$6:$D$14)
Also see the linked image. (NB: My Excel version uses semi-colon ";" in stead of comma "," to separate arguments in functions.)
Best of luck!
Xharx
Image of the Excel sheet solution
Here's How u Do it. First we have to have starting month from where were gonna start counting I made this formula which works great, =WORKDAY(EDATE($B$15,COUNT($B$15:B17))-1,1,holiday1)
were freezing the starting date and counting how many rows are we from the starting position , then were gonna minus 1 from it , and in days were gonna type 1, if there's holidays that I wanna exclude too I just can enter it and give it a name, (Some of u who doesn't understand this, its just saying that its referring to specified cells which we named holidays) and it works flawlessly.
B15 = starting month

Get working day of the month with the lowest value

I have a excel spreadsheet with two columns. One with a date and another with the value.
I want to get the working day of the month with the lowest value.
I tried to use a pivot table for it and then group the date but I get a lot of errors.
You can find the spreadsheet here and the sheet name is Historical. The others are just attempts made by me.
Spreadsheet
Thanks
The formula entered in E2 below
is
=AGGREGATE(15,6,(POWER(10,LOG10(((YEAR(D2)=YEAR($A$2:$A$3254))*(MONTH(D2)=MONTH($A$2:$A$3254)))))*$B$2:$B$3254),1)
and the array formula entered in F2 below is
=INDEX($A$2:$A$3254,MATCH(YEAR(D2)&MONTH(D2)&E2,YEAR($A$2:$A$3254)&MONTH($A$2:$A$3254)&$B$2:$B$3254,0))
I suggest to make an triple nested if-construct that checks if the weekday of the date is a workday, or the date+ 1 or the day +2. Assuming the date is in cell A4
= if(instr(weekday(A4),”23456”)>0, A4,
if(instr(weekday(A4+1),”23456”)>0, A4 + 1,
if(instr(weekday(A4+2),”23456”)>0, A4 + 2,”cannot happen”)))
Explanation: one of 3 consecutive days is always a working day.
There may be typos since I edit that on iPad without Excel available to test.
Weekday returns 1 for Sunday and 7 for Saturday. So 2-6 are workdays.
However with that simple approach you will not detect public holidays on a working day if that is a problem.
Hope I understood you question correctly. One data example with solution would have explained it better.

How to calculate number of days in Excel

I have a date format like 2020-01-17.I would like to calculate number of days till today date. I'm trying it's like
=today() - B2
However it's not working.
Edit
I changed the format to 01/17/2020 and did
=today() - B2
The result comes as 3/23/1900.
This is wrong and I would like to see in number of days.
very simple
Check Out Image enter image description here
I think there are 2 issues that you're seeing here.
The result comes as 3/23/1900.
The reason you're seeing this result as 3/23/1900 is probably because of the format of the cell. Change cell format to number and you should see your result as a number.
Or you can also use the formula with a VALUE formula like so =VALUE(today() - B2)
I would like to calculate number of days till today date
You can always use a simple subtraction of the two dates.
You can also use the DATEDIF function and extract the difference between dates in Years, Months, Days and more. Example: =DATEDIF(today(), B2,"D")
Here is the documentation for this DATEDIF function.
Note: Below is the warning from Microsoft
Warning: Excel provides the DATEDIF function in order to support older workbooks from Lotus 1-2-3. The DATEDIF function may calculate incorrect results under certain scenarios. Please see the known issues section of this article for further details
You can you use the datedif fx link: https://exceljet.net/excel-functions/excel-datedif-function
=DATEDIF(B2,TODAY(),"D")

How do I find the missing amounts between different months?

So my problem is this, currently I have an amount of money with start date and end date. I'm able to calculate the beginning month and end month money but I'm having a lot of trouble trying to figure out the in between months amount. Then once figuring that out to combine all three equations into a single situation to be able to type in any start date, any end date, then amount that automatically calculates for each given month automatically.
The table looks like this:
As you can see it calculates May and August by pasting the calculations into those cells manually. But, I'm not able to figure out how to calculate the middle portion then putting the formula into one single formula to be able to automatically calculate.
The code that I currently have to calculate May is:
=(MAXIFS(Dates!$A:$A,Dates!$B:$B,VLOOKUP($B$2,Dates!$A:$C,2))-$B$2)/($B$3-$B$2)*$B$4
This calculation is essentially if the start date is on 5/26/2019 start at that date, to only calculate 6 days for this example. Then calculate the amount needed for those 6 days.
The August Formula is:
=IF($B$3<=MAXIFS(Dates!$A:$A,Dates!$B:$B,VLOOKUP($B$3,Dates!$A:$C,2)),($B$3-MINIFS(Dates!$A:$A,Dates!$B:$B,VLOOKUP($B$3,Dates!$A:$C,2))+1)/($B$3-$B$2)*$B$4,"No")
This does the same as May where when it ends, in this case 8/15/2019 it only calculates up until 8/15/2019 and not the entire fiscal month.
The Dates sheet looks like this:
This is just a sample of the data as the sheet itself is too big to show in a picture. But here is how it lays out for a Fiscal Year:
What I want the end result to look like is:
But also to have it automatic where anyone could enter in Start Date/End Date/Amount and it auto calculates everything for the person. The dates can go from February - January or just a single month as well.
Any help would be much appreciated and if anything needs to be expanded on please let me know as I'm not sure how to ask a question for this specific problem.
Thanks in advance,
-Maykid
Use an array formula:
=SUM(if(LOOKUP(row(index($XFD:$XFD,$B$2):index($XFD:$XFD,$B$3)),Dates!$A:$A,Dates!B:B)=C$1,$B$4/($B$3-$B$2)))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
Put in C2, hit Ctrl-Shift-Enter then copy over.

How do I shorten the formula for comparing two dates in excel standard date format?

I have created a formula to compare two dates. M673 is a date that is manually entered but sometime copied over which leaves that unnecessary " "in the front from time to time which makes the date extraction difficult (that's why I trimmed it). The date in N673 is extracted from a manually entered period (i.e. 08/2015) 08 is actually October (10). The extraction formula looks as follows:
(N673)=IF(A673="","",DATE(RIGHT(A673,4),LEFT(A673,2)+3,))
This is to ensure it updates for every period posted automatically.
The below formula says if M673 is before N673 but on the first day of that month and year, then it becomes 1 else its a 0.
Any way to shorten the below formula?
(G673)=IF(DATE(LEFT(TEXT(TRIM(M673),"yyyy-mm-dd"),4),MID(TEXT(TRIM(M673),"yyyy-mm-dd"),6,2),RIGHT(TEXT(TRIM(M673),"yyyy-mm-dd"),2))<(DATE(LEFT(TEXT(N673,"yyyy-mm-dd"),4),MID(TEXT(N673,"yyyy-mm-dd"),6,2),1)),1,0)
Have you tried to use DATEVALUE? The following should work for the scenario you have described above.
(G673)=IF(DATEVALUE(TRIM(M673))<N673,1,0)
There's no need to create a new date based on all the parts. This is what DATEVALUE will do for you automatically.

Resources