how do I generate random timestamps in Excel [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 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.

Related

How to automate the creation of a list based on an integer input 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 3 years ago.
Improve this question
This is undoubtedly a very simple problem, but I don't have much experience with coding in Excel.
In this example, I would like the user to input the # of students into cell B3.
After inputting the # into the cell (for example, if the person input 5), I would like to create that number of rows from A4-A9 based on the notation Student_# (Student_1, Student_2, Student_3, Student_4, Student_5).
If the person put in 10, I would like there to be 10 rows of Student_1 through Student_10 (updated automatically).
The "Student_" will be static as this is an unidentified list, I'd just like to create the number of rows based on this initial input value.
Thanks in advance for any help.
In A5 put:
=IF(ROW(A1)<=$B$3,"Student_" & ROW(A1),"")
And copy down enough to cover the largest number allowed in B3
If one has the Dynamic Array formula simply put:
="Student_"&SEQUENCE(B3)
In A5 and Excel will spill the results down.

Looking for a formula that recognises different digits in a cell [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 am creating a spreadsheet where the user can enter different numbers and have a different result be returned.
For example if they were to enter a number that started 07, it would show 1, 070 it would show 2, 0345 3 and so on.
I have tried the IF and LEFT formulas but I am struggling!
Any ideas are greatly appreciated!
EDIT: Sorry I was trying not to write war and peace but have missed out too much.
The users will write in phone area codes, e.g. 0345 or 0714 or 0701 and the sheet will return the price.
The price can be different depending on the first 4 digits. To keep it simple for this purpose I want it to be able to detect if the area code starts with 07 to show a "price" of 1, 070 price of 2 and 0345 a price of 3.
I have 10 different area codes but just added the 3 above for examples.
I hope this is clearer.
To get the length of a string with the leading zeros removed use the array function
=LEN(MID(A2,MATCH(TRUE,(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)<>"0"),0),LEN(A2)))
Replace A2 with the cell that the users will change and hit [Ctrl Shift Enter] on the cell with the formula to activate the array function.

excel skip over cells based on variable [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'm working on a budgeting spreadsheet that has a different replacement cycle for equipment and I want to visualize when everything will be scheduled to be replaced.
Column 1=name, Column 2=deployed, Column 3=expected life, Column 4=retire date, Column 5=price
I want to have another table next to it that shows the next several deploy dates (for the next 15 years) based on the expected life. Right now, I'm having to manually count over X number of cells and enter in the price and then count over again.... for each row.
I know there has to be a automated way to do this, but I'm new to excel macros and I've looked at several functions, but can't get anything figured out. What functions should I be looking at?
A formula like:
=IF((G$1-YEAR($B2))/$C2=ROUND((G$1-YEAR($B2))/$C2,0),$E2,"")
Should do the trick
(the above for column G, it is assumed the year is in G1)

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.)

Calculating a difference in numbers [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 7 years ago.
Improve this question
I'm trying to calculate a difference in numbers with Excel 2010. Let's say I have four cells (110, 108, 106 and 104). It's pretty clear that the difference between the four numbers in total (so starting and ending one) is 6. This is the answer I want in the fifth cell; 6. However, if I add another cell between cell 4 and 5 (4 being the lowest number and 5 being the difference), I want the newly created 6 cell (the old 5 - difference answer) to also include the new fifth cell, which is - for example - 100, making the difference 10.
=MAX(A1:A4)-MIN(A1:A4)
will return the answer you're looking for, and the ranges will dynamically update if you insert cells into the A1:A4 range.

Resources