How could we add value + 5 to the entire column - excel

I have an excel file
sno, date time , open , close
In the date and time colum I would like to change the time from EST or lets say add +5 hours to the entire column how could this be done

1 Day = 1, so 5 hours = 5/24, or a fraction of 1.
In a new cell, add =5/24, then copy/paste values. You should have a hard-coded 0.208333333333333
Now re-copy the hard-coded 0.208333333333333.
Select the entire date column, and paste special using the Add functionality.
Then reapply date formatting as needed.
If it's easier for you to understand, you can use =TIME(5,0,0) instead of =5/24.

Assuming your dates start from B2 cell:
• Input 05:00:00 in column E2
• In F2 input: =B2+E2
• Drag down E2:F2 range down

Related

change date format m/d/yyyy to dd/mm/yyyy using formula

sr date date-text mm dd yyyy concat(dd,mm,yyyy)
1 12/31/2018 12/31/2018 12 31 2018 31/12/2018
2 3/31/2019 3/31/2019 3/ 1/ 2019 1//3//2019
as shown above i have some dates in col 'date' formatted as m/d/yyyy. i need to convert this to dd/mm/yyyy. i tried DATEVALUE funtion but it gives value error as my pc date format is dd/mm/yyyy. Unfortunately i cant change my PC date format.
So i tried to split the date using LEFT,MID and RIGHT function.
date-text = TEXT([#[date]],"mmm/ddd/yyyy") - to fix date format to mm/dd/yyyy
mm =LEFT([#[date-text]],2)
dd =MID([#[date-text]],4,2)
yyyy=RIGHT([#[date-text]],4)
concat(dd,mm,yyyy) = =CONCAT([#dd],"/",[#mm],"/",[#yyyy]) to get mm/dd/yyyy for mat.
This approach works for row 1 but for row 2 i get wrong date "1//3//2019". please let me know how to fix this
Try following formula
=DATE(RIGHT(A1,4),LEFT(A1,SEARCH("/",A1)-1),TRIM(MID(LEFT(A1,SEARCH("/",A1,SEARCH("/",A1)+1)-1),SEARCH("/",A1)+1,2)))
You can get the result you want with just one formula:
=DATE(VALUE(RIGHT(A2;4));VALUE(MID(A2;1;FIND("/";A2;1)-1));VALUE(MID(A2;FIND("/";A2;1)+1;FIND("/";A2;FIND("/";A2;1)+1)-FIND("/";A2;1)-1)))
I understand very well your situation. I'm from Portugal and here we have the same date format as you (dd/mm/yyyy). Pay attention to your pasted values as a "date". For instance, if you place 3/31/2019 Excel won't recognize it as a date and paste it as text (that's why you don't need your date-text column). However, if you paste 1/12/2019 Excel will write automatically 01/12/2019 when the true date is 12/01/2019 and the formula will not work.
Simplest way for me is to use text to column function. select m/dd/yy dates and go to "Data" select text to column function located in "data tools". This enables the Text Wizard - select the delimited button. hit "next". Step 2 wizard box appears which is where you choose your delimiters. remove any ticks except for "Other" and tick this box. Click "Next". Step 3 of 3 box appears. IMPORTANT Choose your destination carefully. Ideally select a blank cell at the end of your existing data. In this way the results of the text to data function can be freely edited. If you have selected your original data correctly every cell will transpose as m - dd - yyyy. Cut and paste the year to its RH adjacent column and transpose the "m" to the blanks cells that were occupied by the "yyyy". Now you'll have 3 columns "dd", "mm", "yyyy". with a Blank column where the "m's" were. Select the blank cell to the left of the first row of transposed data. Enter the formula "=VALUE(ddcell&"/"&"mm"cell)
you should get a result of 1/01 (if that's the date your modifying). If the current year is 2022 then that will be added automatically. If not you'll have to modify your formula to include the date you want. If the result shows just a number go to your home tab and then number options. Select "Short Date" and it will all happen. With some practice this procedure is a breeze and saves writing those long messy formulas.
Good luck from Henry

How to auto populate the next week in excel

I am making an on-call schedule in excel and I can't for the life of me find an easy way to populate the dates. For example, someone is on call from Monday to Sunday, January 2nd - January 8th. Then the next person is on call from January 9th - January 15th. I am trying to figure out a way or formula to just "Drag" down the column and it input the next 7 day range. I have tried input the start date and end date in a separate cell, then using concatenate but it returns the date number in excel (forgot what its called). I also tried =(A1&" - "&B1) but that returns the same 5 digit number.
Any help or pointers are greatly appreciated!
Previous date + 7
If you have genuine dates, say in cells A1 "start date" and B1 "end date":
Jan 2 Jan 8
Then the next line will be
=A1+7 =B1+7
Verify Dates
To see, if the "Dates" you entered are realy dates excel can work with like that, apply "General formatting" to the A1 and B1 cells. If the resulting value is an Interer or a Decimal number, you are golden. If the resulting value did not change, you have a text and you need to apply different approach.
Perhaps you are looking for this:
=TEXT(A1,"d-mmm")&" - "&TEXT(B1,"d-mmm")
The formatting specification can be copied from the formatted cell properties.

Identifying date in text file While date is incorrectly formatted

I need to extract the date from C2 and find the difference between the date in c2 and A1
The date is formatted as "Jul, 18 2015", any ideas? EDIT the database has a different amount of text per cell. Is there away around this so that i can apply the formula to every cell and pull the day/month/year?
you are going to need to go through a series of string manipulation and date time functions. Lets start by assuming your string is in the C2 cell. In order to do this we are going to work from the largest unit (years) to the smallest unit (days). You can do it in any order as it will all be lumped into once formula, but for the breakdown of steps its good to have an order.
Step 1) PULL OUT THE YEAR
=MID(C2,FIND(" ",C2,FIND(" ",C2)+1)+1,4)
That will give us the last 4 characters of the string after the second space which in this case is the year.
Step 2) PULL OUT THE MONTH
=MONTH(DATEVALUE(MID(C2,2,3)&"-"&1))
that looks at second character and pulls out the string 3 character long which is your month. It then converts it to a format that excel tends to recognize as a date short form by adding a - and the digit 1 to it. So in your case if would look like Jul-1. Datevalue converts this to an excel date serial, which we then pull back and grab the month from and in your case that is 7
If the above formula does not work for you it could be due to regional settings. If that is the case you can use the following:
=MATCH(MID(C2,2,3),{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0)
If you use this alternat formula , be sure to adjust the final equation accordingly.
Step 3) PULL OUT THE DAY
=TRIM(MID(C2,FIND(" ",C2)+1,2))
So the above formula finds the first space and then starts pulling then next 2 characters after it. Now since I do not know if the first of the month is 01 or just 1, it may wind up grabbing the space after the 1. The trim function removes excess spaces.
Step 4) BUILD THE DATE
The DATE function in excel requires the YEAR, MONTH, and DAY and converts those values in to the excel date serial. In this case we will convert:
=DATE(year,month,day)
to the following by substituting our equations from above:
=DATE(MID(C2,FIND(" ",C2,FIND(" ",C2)+1)+1,4),MONTH(DATEVALUE(MID(C2,2,3)&"-"&1)),TRIM(MID(C2,FIND(" ",C2)+1,2)))
The final touch is to ensure your cell is formatted as date and not General or some other format which will result as the date being displayed in an integer format.
Now assuming you date in A1 is in Excel format, you would simply add A1- to the front of the last formula to give you:
=A1-DATE(MID(C2,FIND(" ",C2,FIND(" ",C2)+1)+1,4),MONTH(DATEVALUE(MID(C2,2,3)&"-"&1)),TRIM(MID(C2,FIND(" ",C2)+1,2)))
Now, if A1 is also in quotes like the C2 formula, repeat the formula for stripping the date out of C2 but use A1 as the reference and substitute it in for A1 in the last formula to give:
=DATE(MID(A1,FIND(" ",A1,FIND(" ",A1)+1)+1,4),MONTH(DATEVALUE(MID(A1,2,3)&"-"&1)),TRIM(MID(A1,FIND(" ",A1)+1,2)))-DATE(MID(C2,FIND(" ",C2,FIND(" ",C2)+1)+1,4),MONTH(DATEVALUE(MID(C2,2,3)&"-"&1)),TRIM(MID(C2,FIND(" ",C2)+1,2)))
FORMULAS USED
Text/String Functions
MID
FIND
TRIM
Date/Time Functions
DATE
DATEVALUE
MONTH

Excel - Convert date from yymmdd to dd/mm/yy

I have an Excel file which is exported from a Access database.
I have 25000 records and I will need to replace all of them.
The date column is not formatted (yymmdd). I need to change the date format from yymmdd to dd/mm/19yy. For the yy I need to add a constant value 19 in front of it so it would be 19yy.
I have only 1 date column per row
Is there any way to convert all the 25000 record's column formatted in yymmdd to dd/mm/19yy in a few clicks?. Thank you
This will give you the result as an actual date which you can then format as you wish using Excel's date formatting options.
=DATE(1900+LEFT(A1,2), MID(A1,3,2), RIGHT(A1,2))
If you don't need to parse it into a date value, but merely need to display a date in the format you identified, the following will work on a value in cell A1 (copy down to the rest of the 25,000 values as needed:
=RIGHT(A1,2) & "/" & MID(A1,3,2) & "/19" & LEFT(A1,2)
In my cell A1, I entered the value 981116. This formula converted it to 16/11/1998. I think that's what you're looking for, right?
Assuming data starts at A2 put this formula in B2
=(19&TEXT(A1,"00-00-00"))+0
Now format B2 in required date format, e.g. mm/dd/yyyy
and you can easily "fill down" all 25000 rows by doing this:
put cursor on bottom right of B2 (first cell with formula) until you see a black "+" - that's the "fill-handle" - double click and the formula will populate as far down as you have continuous data in the adjacent column
Note: you can probably omit the 19& if all your dates are after 1930 because the default is to treat any date written without the century as 1900s if it's >=30 or 2000s if it's <30 [although you can change that in regional settings]

Converting MM:SS.ms to seconds using MS excel

I am looking for a neat way of converting a cell from
Minutes:Seconds.Milliseconds to
Seconds.Milliseconds
i.e.
11.111 = 11.111
1:11.111 = 71.111
I have something in place at the moment but its a bit hacky and I am sure there must be some nice excel feature to do this for me :P
Thanks!
Do this:
Place values 0:0:11.111 and 0:1:11.111 in cells B3 and B4 respectively.
Now format it to account for the milliseconds... Select cells B3 and B4, right click and choose Format Cells. In Custom, put the following in the text box labeled Type:
[h]:mm:ss.000
Now on cell C3 put the following formula:
=B3*86400
Fill C4 with the same formula...
Format column C as Number with 3 decimal places.
You're done! :)
Here's a screenshot of the attempt I made and that worked:
Edit:
As you wanna enter only MM:SS.ms you can format the entire B column with a custom format like: mm:ss.000. Now you can enter values as 02:11.111 and it'll convert it accordingly giving you 131.110. Hope it helps.
say your time is in cell A1, place this formula in B1
=IF(LEN(A1)>5,VALUE(TEXT(A1,"[ss].00")),A1)
If the time is less than a minute it outputs the time unaltered, greater than 1 minute it converts it to seconds & milliseconds (2 decimal places).
This will only work if your time in A1 is 10 seconds or greater.

Resources