Total Number of days hours and minutes [closed] - excel

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm looking for how many days hours and minutes elapse between today and 27/08/2020 17:00.
Is there and formula where i can achieve this?
The output should look like this:
0 Year, 1 Month, 7 Weeks, 50 Days, 1,207, Hours, 72,427 Minutes, and 4,345,620 Seconds

There are a number of formulas that can help you here, here's how I would handle that.
Put your date in cell A1.
For years enter this formula in any cell:
=DATEDIF($A$1,TODAY(),"Y")
For months use the years formula, but change the "Y" to "M".
For days use:
=DAYS(TODAY(),A1)
For hours use:
=ROUNDDOWN((NOW()-A1)*24,0)
For minutes use:
=ROUNDDOWN((NOW()-A1)*24*60,0)
For seconds use:
=ROUNDDOWN((NOW()-A1)*24*60*60,0)
Applying the formatting you want will add a lot of length, put this formula in any cell:
=DATEDIF(A1,TODAY(),"Y")&" Years, "&TEXT(DATEDIF(A1,TODAY(),"M"),"#,###")&" Months, "&TEXT(DAYS(TODAY(),A1),"#,###")&" Days, "&TEXT(ROUNDDOWN((NOW()-A1)*24,0),"#,###")&" Hours, "&TEXT(ROUNDDOWN((NOW()-A1)*24*60,0),"#,###")&" Minutes, and "&TEXT(ROUNDDOWN((NOW()-A1)*24*60*60,0),"#,###")&" Seconds"

You could use
=NOW()-DATEVALUE("08/27/2020")+17/24
in the cell you want, and then just format that cell using custom formatting like this:
yy "years" mm "months" dd "days" hh "hours" mm "minutes"
You'd need to either refresh that cell regularly, or you can use the Application.OnTime command in a macro to have it recalculate for you.

Related

Time passed since x convert seconds using forumulas and/or vba [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have to log hours in a CRM and the only way to get a running total of the already logged hours is displayed in seconds. In trying to get excel to consider the current time (offset by 08:30 AM) minus the amount of seconds entered, for example;
When the current time is 10:43 AM and I've entered 3600 into a cell the output should be (10:43 - 08:30) - ((3600 / 60) /60) = 1.22 or 01:43.
I can't seem to find anything online in a similar situation and all the formals I've tried end up with failed results, thanks in advance for taking the time to check out my post, cheers
You need to divide the seconds by 3600 to get hours then by 24 to get fractions of a day:
=MOD(A1,1)-B1-C1/3600/24
where A1 contains NOW(), B1 contains the base time (I have used 7:30) and C1 contains the number of seconds.

Calucating the total number of cells in a row that are less than 16 hours [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I need the total number of cells in sheet-1 Column B that are less than 16 hours where Sheet-1 Column A is not equal to 5 in sheet 1 E4 cell.
For Ex please see the image attached.
Please click on this link to find the example
Assuming that
column A of sheet1 are date/times, and not text, and
you are attempting to find how many date/times are more than 16 hours old
then you simply want to place the following formula in sheet2!F7:
=COUNTIF(sheet1!A:A,"<"&NOW()-0.75)
(16 hours is 0.75 of a day.)
If the data in column A is text, then it gets slightly harder as you have to ensure that Excel does not treat the NOW()-0.75 as a date/time. You can trick it by adding an extraneous character to the end of the formatted date/time so that it no longer appears to be valid, e.g.
=COUNTIF(sheet1!A:A,"<"&TEXT(NOW()-0.75,"yyyy/mm/dd hh:mm:ss")&"#")
worked for me. (The extra "#" at the end forced it to no longer be a valid date/time string.)

excel help: trying to create a date formula [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
i want to create a formula like this,
=DATE(YEAR(any)),MONTH((any)),14)
i don't care about year or month only the day.
apparently excel doesn't let me add "any" as a fuction. can someone please help me?
Consider:
=DATE(RANDBETWEEN(1,9999),RANDBETWEEN(1,12),14)
To use the current year and month, use this formula:
=DATE(YEAR(NOW()), MONTH(NOW()), 14)
However, the month does matter if you wanted to put 31 for the day (or 29/30 if the month happens to be February), so you might want to just always use a specific year and month that will allow for maximum flexibility, such as:
=DATE(2000,1,14)
One thing I would suggest is to ask yourself why you are storing this as a date in the first place if you only care about the day of the month. You could just store 14 and label the column "Day of Month". To better answer your question, it would be helpful to know what are you actually doing with these dates.

If formula with 3 different conditions [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to get 3 conditions by using if-else formula or any other relevant one.
I have 3 different dates Starts date, End date and Grace period date for an inventory.
I want "running" if today's date is greater than starts date but less than end date.
I want "Grace" if todays date is greater than end date but less than grace period
I want "Expired" if todays date is greater than grace period date.
I am using this formula but I am getting #value
IF(TODAY()>=E2<=F2,"Running",AND(IF(TODAY()>=F2<=G2,"Grace","Expired")))
You can't combine conditions like that. Instead of testing x>=y<=z, you need to use a logical AND and test both x>=y and y<=z.
=IF(AND(TODAY()>=E2, TODAY()<=F2),"Running",IF(AND(TODAY()>=F2, TODAY()<=G2),"Grace","Expired"))
For multiple if statements you should just use a lookup table instead
Put this in A1:A4 (for example - these are your start date, near to expiry date, finish date and grace date)
01/05/2014
05/11/2014
10/11/2014
10/12/2014
And the following in B1:B4
Running
Near to expiry
Expired
Grace
Your formula would then be:
=INDEX($A$1:$B$4,MATCH(TODAY(),$A$1:$A$4,1),2)
Change TODAY() in the MATCH() formula as needed

how do I generate random timestamps in Excel [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to generate a bunch of random times in Excel 2013.
The time needs to be between 7AM to 8:45AM
The number of rows varies but they are typically between 30 to 60
Using a formula in a cell (for times ranging from 7:00:00AM to 8:44:59AM):
=TIME(7,RANDBETWEEN(0,104),RANDBETWEEN(0,59))
In Excel, one day = 1
7AM = 7/24
845AM = 8.75/24
Enter the formula:
=7/24+RAND()*(8.75/24-7/24)
On the Home tab of the Ribbon, select 'Time' from the dropdown in the Number area.
This will generate a random time starting at 7am and continuing through 845am.
Fill the cells with:
=RAND()*(0.364583-0.291667)+0.291667
you want to generate random time between two given times, such as generate time from 6 o'clock to 9 o'clock, you can use below formula. Type this formula: =TEXT(RAND()*(8:45-7)/24+6/24,"HH:MM:SS") into a blank cell, and drag the fill handle over to the range that you want to insert the time.

Resources