To try and make an everyday task for myself easier, I've been attempting to use:
=CONCATENATE(A1:A9)
Basically I have to grab groups of cells and wrap the text to fit in an attribute box elsewhere. I figured doing it right in Excel would be easier than writing something original with, say, Python, but I'm not having any luck. I get that vague #VALUE! error when entering this. Additionally, there shouldn't be any delimiter. The goal is to tie each cell end to end, wrapping it, without spaces, like I mentioned above.
For clarification, I'm using Excel 2016.
Does anybody have a remedy?
CONCATENATE(A1:A9) accomplishes nothing. It just returns A1:A9.
I assume you want this:
= CONCATENATE(A1,A2,A3,...A9)
Or:
= A1&A2&A3&...&A9
Possibly also TEXTJOIN if you have the right version of Excel.
If you have Excel 2016 or 365, use TEXTJOIN:
=TEXTJOIN(" ",TRUE, A1:A9)
The " " means that your values will be delimited by spaces (put a comma or dash or whatever you need in there); the TRUE means that it will not include empty cells (change it to FALSE if you want placeholders for those); A1:A9 is your range that will be concatenated.
Related
I want to apply data validation to reference numbers, to force the following layout (ideally uppercase only):
XX_NNX-XX_NNN_NN-XXX
X = Numbers
N = Letters
Ex: 12_AB1-23_ABC_AB-123
The following custom formula allows all of it except for numbers - is there any workaround for this?
I don't want to use * since it allows for more characters than I want.
=COUNTIF(A1,"??_???-??_???_??-???")
You can choose AND to add a condition to the function you have already written. e.g. following shall test the positions which shall be numeric.
=AND(COUNTIF(A1,"??_???-??_???_??-???"),ISNUMBER((LEFT(A1,2)&MID(A1,6,1)&MID(A1,8,2)&RIGHT(A1,3))+0))
Notes: This is fairly basic approach and may need some tweaks if you have cases involving usage of decimals etc.
Edit: You can try below approach for checking upper case text in specified positions.
=AND(COUNTIF(A1,"??_???-??_???_??-???"),ISNUMBER((LEFT(A1,2)&MID(A1,6,1)&MID(A1,8,2)&RIGHT(A1,3))+0),INDEX(FREQUENCY(-CODE(MID(MID(A1,4,2)&MID(A1,11,3)&MID(A1,15,2),ROW($A$1:$A$7),1)),{-91,-65,0}),2)=7)
Edit2: This turned out to be tougher than I had imagined. Following formula works in DV for cell A1.
=AND(COUNTIF(A1,"??_???-??_???_??-???"),ISNUMBER((LEFT(A1,2)&MID(A1,6,1)&MID(A1,8,2)&RIGHT(A1,3))+0),MIN(FLOOR(CODE(MID(MID(A1,4,2)&MID(A1,11,3)&MID(A1,15,2),ROW($A$1:$A$7),1)),65))=65,MAX(CEILING(CODE(MID(MID(A1,4,2)&MID(A1,11,3)&MID(A1,15,2),ROW($A$1:$A$7),1)),90))=90)
But due to some quirk, Excel won't let me simply paste it. So I wrote a small code for the same which applies DV to cell A1 and surprisingly it accepts that same long formula through code. Make sure that you delete DV in the cell before you run this code.
With Range("A1")
.Value = "12_AB1-23_ADC_AZ-123"
.Validation.Add xlValidateCustom, , , "=AND(COUNTIF(A1,""??_???-??_???_??-???""),ISNUMBER((LEFT(A1,2)&MID(A1,6,1)&MID(A1,8,2)&RIGHT(A1,3))+0),MIN(FLOOR(CODE(MID(MID(A1,4,2)&MID(A1,11,3)&MID(A1,15,2),ROW($A$1:$A$7),1)),65))=65,MAX(CEILING(CODE(MID(MID(A1,4,2)&MID(A1,11,3)&MID(A1,15,2),ROW($A$1:$A$7),1)),90))=90)"
End With
Once in there, you can get it in any other cell by simply doing copy >> Paste Special >> Validation.
For clarity, I use Excel 2016.
When I try to enter Vlookup formula manually in Excel, I get the following error;
excel manual vlookup error. This error appears while I'm defining the second element of the formula from another excel file and it doesn't let me to define the area.And it directs me to use formula wizard, however it's not useful and efficient for me. Has anyone experienced this problem before?
You may find the formula I try to use as below;
=vlookup(S2;'[Copy of Material Master_S112.xlsx]q_S112'!$G$2:$I$7
after this point it doesn'let me to make any change and directs me to formula wizard.
Thank you for your help in advance
VLOOKUP() takes 4 arguments:
Value to seek.
Target range.
Number of result column relative to the first column of target range. E.g. if your target range is $G:$I and you need results from column H this parameter should be 2, if you want results from column I - then 3.
Parameter specifying whether you need exact (TRUE) or approximate (FALSE) match. Set it to FALSE in most cases.
And of course you need closing parenthesis ) at the end.
So the correct formula should look something like this:
=VLOOKUP(S2;'[Copy of Material Master_S112.xlsx]q_S112'!$G$2:$I$7;3;FALSE)
If you use Ctrl-Shift-Down after you have started to enter the second parameter you will get the "you have entered too few arguments" message.
You can only use Ctrl-Shift-Down after selecting a cell but before you have entered anything for the second VLOOKUP parameter.
As I mentioned in my comment, arguments in Excel formulas are separated by commas, not semicolons.
For example,
=VLOOKUP(S2, '[Copy of Material Master_S112.xlsx]q_S112'!$G$2:$I$7, 2, FALSE)
Thank you for all your answers. It's kind of interesting but, I have to hit at first shift and then control not to get this error. It wasn't like that before but when I hit control first and then shift+down it gives the error. But at least it works like this.
if you use win 10 , you must change the regoin configoration .
in control panel > region >formats> additional setting> list separator
change content to ";"
How to find duplicated combination in excel were order does not matter. I have tried using concatenation and sorting them out but its a waste of space, if only there was another way to achieve this without concatenating. Id truly appreciate it.
Example:
For exact 4 columns and up to 1000 rows:
{=IF(SUM(IF(MMULT({1,1,1,1},TRANSPOSE(COUNTIF($A1:$D1,$A$1:$D$1000)))=4,1))>1,"duplicate","unique")}
This is an array formula. Input it into E1 without the curly brackets. Then press [Ctrl]+[Shift]+[Enter] to confirm.
Copy downwards as needed.
If it not works, please check the language version of your Excel and the locale of your Windows. Maybe the array constant {1,1,1,1} in my formula must be written as {1\1\1\1} or {1.1.1.1} because the comma will be in conflict with the decimal separator or list delimiter.
Doesn't matter what version of excel you are using. Just click on the Data tab at the top.
Select the column where you seem to find the duplicates.
You can see Remove Duplicates listed somewhere, and you are done.
Else if you don't want to remove the values, try using the Filter. This will let you know what values are actually Duplicates.
Im trying to write a formula that will check if 2 cells in a row are blank and if they are / arnt output true / false. Ive been working with isblank() and have put together this :
=IF(ISBLANK(L2) AND ISBLANK(N2), blank, not blank) but it returns a formula parse error, any ideas why this might be ?
Im doing this inside of google spreadsheets, so ideally id prefer not to use vba.
You're using an AND operator from a language that Excel can't compile.
In Excel it's an AND function with syntax:
AND(logical1, [logical2], ...)
Also the returns, being strings, need to be within double quotes in Excel functions so:
=IF(AND(ISBLANK(L2),ISBLANK(N2)),"blank", "not blank")
=if(and(isblank(L2),isblank(N2)),"blank","notblank")
I am having trouble adding a zero after the decimal when coding in excel. The number that is being output is 240 and I want it to say 240.0. I have tried the round function in excel however that is only working when I have something like 242.46 and it gaves me 242.5.
Try:
oWrkSheet.Cells(110, 17).NumberFormat = "0.0"
It can work for many other numeric formats. See this post for more informations.
You can use a formula:
=TEXT(A1,"0.0")
Either change A1 to the appropriate cell, or surround the cell in question with a =TEXT(...,"0.0")