How can I make a cell A1 "1234" with cell A2 "27" to make 12340027 as a number not text. In short, numbers in A2 are 1, 2 or 3 digits in length but they must be formatted to 4 digits e.g. 27= 0027, 4=0004. Using TEXT is resulting in lookup functions not working
How about:
=A1*10^4+A2
Just adds 4 zeros to the end of A1 and then adds A2 to it.
#keatz also elegant answer
If I got you correctly,
you can achieve it by this formula:
=CONCATENATE(A2,RIGHT(B2/10000,4))*1
Wrap your formula in VALUE() to turn the text back to a number:
=VALUE(A1 & TEXT(A2,"0000"))
Or multiply the text by one (or add zero):
=(A1 & TEXT(A2,"0000"))*1
Related
Excel Problem.
Let's say I have 2 cells.
A1: HE11294419-12
A2 11296581
I would like to extract the number after the dash found in A1, in another cell.
In case of A2 - the cell should say just "1".
So the result should be
B1: 12
B2: 1
Assumptions:
Always just one dash in string
In case no dash, extract the last number of string
Try in B1:
=IFERROR(MID(A1,SEARCH("-",A1)+1,LEN(A1)),RIGHT(A1,1))
Drag down.
In case the second assumption is wrong, and it always needs to be one just change ..RIGHT(A1,1) to ..1
You can try below formula. It will return first numbers after - if there are multiple - in cell.
=IF(ISERROR(SEARCH("-",A1)),1,TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",100)),100,100)))
I need a formula in Excel, not VBA please, forbidden to have such functions on my work machine. My situation is I need a number from cell A, which is a result from Today(), combined with a number from cell B, which is a result from Now(), combined with a number from cell C which is a text number, to output as a single number.
Example:
Cell A1 Cell A2 Cell A3
Formula: TODAY() NOW() 17709
Displays: 1011 1423 17709
Needed: 1011142317709
What I'm trying is this, which is a fail: =TEXT(O21,yy-mm)&""&TEXT(P21,hh,mm)&"""&VALUE(Q21)
=TEXT(O21,"yymm")&""&TEXT(P21,"hhmm")&""&VALUE(Q21)
Placed in quotes the number format and removed extra quote though not sure why you are adding null to the string.
To match the sample output OP provided the formula would be:
=TEXT(A1,"mmdd")&""&TEXT(B1,"hhmm")&VALUE(C1)
If you do not need leading zeroes to fill 5 digit placeholders for the value in Q21,
=TEXT(NOW(),"yymmhhmm")&TEXT(Q21, "0")
'possibly,
=TEXT(NOW(),"mmddhhmm")&TEXT(Q21, "0")
If you do need leading zeroes to fill 5 digit placeholders for the value in Q21,
=TEXT(NOW(),"yymmhhmm")&TEXT(Q21, "00000")
'possibly,
=TEXT(NOW(),"mmddhhmm")&TEXT(Q21, "00000")
I have 3 names that I want to combine to create something unique - I've used "CONCATENATE", but to no avail.
Example:
Paper (will always be different)
000001 (This will be sequential, the next row will have 000002)
Plastic (will always be different)
Essentially I want to input all three items in different cells and have the fourth cell output the following:
Pa000001Pl
Thank you.
Using & between objects is an alternative way to concatenate in excel:
=LEFT(A1,2) & B1 & LEFT(C1,2)
See http://fiveminutelessons.com/learn-microsoft-excel/extract-text-cell-excel for info on how to extract text from cells. (Examples: LEFT(), RIGHT(), MID(),FIND().
See https://support.office.com/en-za/article/Combine-the-contents-of-multiple-cells-3a86c317-6b91-4f1d-8781-203320aefdce for info on how to combine text from cells.
If you want to keep the 00000's in the number you need to make sure to format the cells containing the numbers as Text.
You could do this using the TEXT() function on the fly:
=LEFT(A1,2) & TEXT(B1,"000000") & LEFT(C1,2)
The six 0's tell Excel to create a number 6 digits long and replace any 0 with a non-zero number from your cell. So if B1 is 1, TEXT(B1,"000000") will convert it to 000001. If B11 is 11, TEXT(B11,"000000") will convert it to 000011.
If you instead want to ensure that the same number of 0's remain in front of your non-zero numbers, you could use the CONCATENATE() function:
=LEFT(A1,2) & CONCATENATE(B1,"00000") & LEFT(C1,2)
This would always insert five 0's in front of whatever number is listed in B1.
With values in A1, B1, and C1, in another cell enter:
=LEFT(A1,2)&TEXT(B1,"00000")&LEFT(C1,2)
This is needed to preserve the leading zeros if those leading zeros are the result of formatting cell B1
Assuming your values are in the 2nd Row
=LEFT(A2,2) & B2 & LEFT(C2,2)
How do I make a cell show some of the characters of another cell?
For example cell A1 shows 'abc12345' and I want cell A2 to show '123' (i.e. characters 4 to 6).
Thanks in advance!
= mid (A1, 4, 3) would return 123
where A1 is the cell with the text string.
4 is the initial location to start getting the string
3 is the length of the string you will get.
This is the simple solution.
This one looks for the first numeric value and gives anything before that, press ctrl+shift+enter to run.
=LEFT(A1,MIN(IFERROR((MID(A1,ROW(A1:A200),1)+0)*ROW(A1:A200),FALSE))-1)
Hope that helps.
Following is the which I am trying :
Let this number 6,123,456.33 in Cell A1,
Then in Cell B1 use this formula =TEXT(A1,"#,###,###.##"), will give you 6,123,456.33.
Then in Cell C1 use this formula = SUBSTITUTE(B1,",",".") ,will give you 6.123.456.33
Then in Cell D1 use this formula =","&RIGHT(H12,2), will give you ,33.
Then again come to Cell C1 Do text to columns or other options to remove the last digits with decimals and then concatenate result with Cell D1 shows the last three digits.
This tip will ends up in 6.123.456,33
But Problem is in point no. 5.
How should I remove .33 from cell C1?
TRUNC is not working on C1.
Any Suggestions ?
Seems like you don't mind having the result as text (and I can't seem to find a way to custom format it...) and as such, you can use the formula:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(A1,"#,###.00"),",","#"),".",","),"#",".")
There's a triple substitution, one to remove , for # (a dummy character), second to change . to ,, then last from the dummy # to ..
If A1 is always a 7 digit number with 2 decimals then you could use TEXT function like this:
=TEXT(A1*100,"0\.000\.000\,00")