I would like to convert text - Apr 7 2017 into date format on Excel spread sheet. Is there a formula that might help with it?
I have already tried format cell into date format but this did not change the cell properties. Thank you for your suggestions
With data in A1, in another cell enter:
=DATEVALUE(LOOKUP(LEFT(A1,3),{"Apr","Aug","Dec","Feb","Jan","Jul","Jun","Mar","May","Nov","Oct","Sep"},{4,8,12,2,1,7,6,3,5,11,10,9}) & MID(SUBSTITUTE(A1," ","/"),4,99))
An alternative:
=DATEVALUE(TRIM(MID(A1,5,2)) & "-" & LEFT(A1,3) & "-" & RIGHT(A1,4))
Related
I've got sheet with name April 21 and other sheet with name Summary.
I'd like to prepare cell formula in Summary sheet that will refer to April 21 sheet's cell M10. This works for me just fine, it displays valid value in Summary sheet cell:
='April 21'!$M$10
I try to generify this formula using INDIRECT formula, but it doesn't work at all
=INDIRECT("'" & $D$6 & " " & RIGHT($B$3;3;2) & "'!$M$10")
where D6 contains month name and B3 contains a concrete year, like 2021.
What is wrong with my formula?
You doing wrong in RIGHT() function. Right function has only two parameter. So, it will be like RIGHT($B$3,2). What you write is MID() function format. Try below formula.
=INDIRECT("'" & $D$6 & " " & RIGHT($B$3,2) & "'!$M$10")
If the cell with the year is a date formatted cell then the value will be a float value you take right from.
If that is true then you can use year() to get the year from the date as a string and take right of the string to get 21.
=INDIRECT("'" & $D$6 & " " & RIGHT(YEAR($B$3);2) & "'!$M$10")
If the value in Cell D6 is a date value formatted as month name, then your original formula will not work, and you can try the following:
=INDIRECT("'"&TEXT($D$6;"mmmm")&" "&RIGHT(B3;2)&"'!M10")
Try this:
=INDIRECT("'"&TEXT($D$6,"mmmm")&" "&RIGHT(B3,2)&"'!M10")
Or with your regional settings this becomes:
=INDIRECT("'"&TEXT($D$6;"mmmm")&" "&RIGHT(B3;2)&"'!M10")
These assume:
Your cell containing "April" is formatted as a date, showing only the month name; and
Your cell containing "2021" is either a text string or a number.
Hello I'd like to change the format of the cells from my column "I" to "0000" format, using a formula (consequently not using the .NumberFormat method) and VBA.
For instance if range("A1").Value = 09, the formula will transform it to 0009, etc.
I have tried this but it doesn't work :
With Range("I2", Cells(Rows.Count, "I").End(xlUp))
.Value = Evaluate("INDEX(TEXT(" & .Address(external:=True) & ",""0000""),)")
End With
Thank you in advance for your help,
Sincerely,
J.Garry
NON VBA
=right("000"&A1,4)
Basically tag on a bunch of 0s on the front which converts the number to a string, then take the last 4 characters. This is assuming you are working with integers and thus will not be thrown off by decimal points.
This should be a simple process, but I am having difficulty producing the right outcome. I am trying to combine three cells into one, with Alt + Enter or Char(10) separating each value. When I use a simple Excel formula =B2 & Char(10) & C2 & Char(10) & D2 and wrap the text of the destination cell, everything seems normal. But if I try to search for a string in that cell (for example, "WS001"), it won't find the correct string. If I use VBA to perform the same function (i.e. ThisWorkbook.Worksheets("Sheet1").Cells(2, 1) = Cells(2, 2) & Chr(10) & Cells(2, 3) & Chr(10) & Cells(2, 4)), I can then search for the string in B2 and it fill find it.
That problem was addressed (to a degree), but then when I try to link the destination cell to a cell in a different Worksheet (=Sheet1!A2), I encounter the same issue where the search function can't find the string. Is there another method of doing this (I'd like to avoid VBA, because if someone has to edit the file/information in the future, they might not know how to change it)?
Can you clarify what you are looking for based on this example? Column A is the catenation of the three columns to the right, with CHAR(10).
Would you be for example searching for "Shane"? What result would you want?
EDIT
I'm having trouble understanding what you're looking for, but hopefully this can send you in the right direction.
This is my result:
B1 is the data to be searched for
The catenated formula is as follows: (This also worked when they were on a different sheet)
=C6 & CHAR(10) & D6 & CHAR(10) & E6
The "Catenated result" search formula is an array formula (ControlShiftEnter to enter formula)
="Row "&MATCH(TRUE,ISNUMBER(FIND($B$1,A6:A8)))
The "Individual result" search formula is also an array formula (ControlShiftEnter to enter formula)
="Column "&MAX(($B$1=C6:E8)*COLUMN(C6:E8))-2
(the minus 2 is because the first Source Value" column is column C (ie 3)
Is there any way to convert time from 2/28/2013 21:46 (European 24h format) to 2013-02-28 21-46 (dash between hh-mm) using formula in Excel?
P.S. I didn't find such format in the select cell->right click->format cell->date & time.
I need this to rename a lot of .jpg files.
You can do so with a formula as follows, but it will also be converted to text and lose its numeric value:
=TEXT(A1, "yyyy-mm-dd hh-mm")
You can use formatting via Right Click -> Format Cell, but if it's not in your regional settings, you will have to type yyyy-mm-dd hh-mm under "Custom Format" instead of the "Date" format.
Here is how to do it by reconstructing a string value (using A1 for the source):
=MID(A1,FIND("/",A1,4)+1,4) & "-" &
IF(LEN(LEFT(A1,FIND("/",A1)-1))=1,"0","") &
LEFT(A1,FIND("/",A1)-1) & "-" &
MID(A1,FIND("/",A1)+1,FIND("/",A1,4)-FIND("/",A1)-1) & " " &
MID(A1,FIND(" ",A1)+1,FIND(":",A1)-FIND(" ",A1)-1) & "-" &
RIGHT(A1,2)
If you need this within the context of a VBA macro, then:
Sub Macro1()
Selection.NumberFormat = "yyyy-mm-dd hh-mm"
End Sub
So I am writing some formulas for my spreadsheets and wondered if there was a placeholder for this row number.
For example say I am using the formula:
=C4+SUM(F4:N4)
I know I can autofill this, but what I really want is some stock formula like:
=C{this.row}+SUM(F{this.row}:N{this.row})
Is this possible? Thanks
The function you need is INDIRECT(CELL/RANGE as string)
The INDIRECT function takes in a string and uses it to evaluate a cell or range location. This is where you get the flexibility (aka indirection) that you need.
eg your formula would be:
=INDIRECT("C" & ROW()) + SUM(INDIRECT("F" & ROW() & ":N" & ROW()))