I have a row that contains different numbers. first 5 characters from each cell are equal, difference is only in last 3 characters (Example: 10265083, 10265154, 10265360).
I don't need to make the cell so wide as length of the number, because the sheet will be too large visually. So I need to see only last 3 characters in cell. In formula bar should be the whole number, because I need to use full number for further formulas.
Is it possible to do something like this?
I tried all kinds of cell formatting, I didn't find any way only to show the last three digits. Therefore I opt for another approach: just create a helper column, containing the following formula: =MOD(J7,1000).
Related
I have a sheet where I need to split the numbers and text on single cell to 2 columns
https://docs.google.com/spreadsheets/d/1ZaQmWCx2PH6Fhn3RVW9PKpnTv0ML9zAHWzmk3789b04/copy
Please note the data is in single cell and I need to split in 2 columns as shown in the image
The expected outout is
I have tried with =REGEXREPLACE(A796,"[0-9]","")
You may use 2 formula in 2 different cells for this:
Formula #1:
=REGEXREPLACE(A4,"[[:blank:]].*","")
This finds first space and removes everything after that so that we have only starting numbers left in the result.
Formula #1:
=REGEXREPLACE(A4,"[0-9]+[[:blank:]]+","")
This matches starting 1+ digits followed by 1+ whitespace and removes it so that we only have text after starting numbers.
Sheet Demo
You can also try- B2
=TEXTJOIN(CHAR(10),False,INDEX(ArrayFormula(SPLIT(SUBSTITUTE(TRANSPOSE(SPLIT(A2,CHAR(10)))," ","#",1),"#")),,1))
C2=
=TEXTJOIN(CHAR(10),False,INDEX(ArrayFormula(SPLIT(SUBSTITUTE(TRANSPOSE(SPLIT(A2,CHAR(10)))," ","#",1),"#")),,2))
So... this is going to be a difficult explanation...
I am using a barcode scanner to enter a 20 digit number into Excel. Due to the limitations of Excel this has to be done as text, since Excel only allows up to 15 digits.
This means that my cell has a shown value of example 00257108402007839772 but the value "behind" the cell is 257108402007839000 (the last 3 digits are turned to zeros).
I have to check the values for duplicates, and the last digits are in most cases the digits that differentiate the numbers from each other. This means that when doing a conditional formatting on the cells, the most part of the numbers are flagged as duplicates.
So my question is basically - do you know of a way to search duplicates on the shown value, and not on the "real" value of the cell?
I hope this makes sense....
Here is something for you to consider:
As you can see COUNTIF() does not work on these values, but SUMPRODUCT() will when we just directly compare a range against a single cell. Below you'll see an example of conditional formatting:
Rule used on range A1:A4: =SUMPRODUCT(--($A$1:$A$4=$A1))>1
I am trying to compare the numbers in the Reachability Set column with the numbers in the same row of the Antecedent Set column and return the common values in the corresponding cells of the Intersection Set column.
Screenshot:
In Excel 2016 (but NOT Excel 2013), you can use the following array-entered formula.
=TEXTJOIN(",",TRUE,IFERROR(1/(1/(ISNUMBER(FIND(","&TRIM(MID(SUBSTITUTE(B2,",",REPT(" ",99)),seq_99,99))&",",","&A2&","))))*TRIM(MID(SUBSTITUTE(B2,",",REPT(" ",99)),seq_99,99)),""))
seq_99 is a Named Formula
Refers to: =IF(ROW(INDEX($1:$65535,1,1):INDEX($1:$65535,255,1))=1,1,(ROW(INDEX($1:$65535,1,1):INDEX($1:$65535,255,1))-1)*99)
To enter an array formula, after entering the formula in the cell, confirm by holding down ctrl + shift while hitting enter. If you do it correctly, Excel will place braces {...} around the formula.
Although you would think a VBA solution is required, it is actually quite simple to do this with formulae, provided you use a lot of helper columns. These can, of course, be hidden.
All you need is a number of columns equivalent to the maximum of the numerals in the sets, after each of the original columns of your table. For the example supplied, this would be 17 columns.
Here is a screenshot of the new table with the helper columns unhidden:
The follow formulae are entered into the top left cell of each coloured region and filled/copy-pasted/ctrl-entered into the rest of the cells.
Red Cells (entered into B2):
=IF(ISERROR(FIND(","&B$1&",",","&$A2&",")),0,1)
Green Cells (entered into T2):
=IF(ISERROR(FIND(","&T$1&",",","&$S2&",")),0,1)
Blue Cells (entered into AL2):
=IF(B2*T2,AL$1&",","")&AM2
And finally, the result entered into cell AK:
=LEFT(AL2,LEN(AL2)-1)
The formulae work by ensuring that all the numbers in the sets have a preceding, and trailing, comma so that they can be uniquely searched for.
Then it is a simple matter of constructing a grid for the sets where a 1 means the number exists in the set a 0 means it doesn't. Multiplying these two grids together results in the "intersection set".
Then it is a simple matter of reconstituting the result strings.
Caveat:
This solution won't work correctly if there are any spaces in the "Set" data. To overcome this you need to use the SUBSTITUTE() function.
I'm trying to format a column based off of another (let's say column B2). The column contains a value like "ABC011" and I need to bring in just the letters "ABC".
For another column I also need to bring in just the numbers "011" but without the trailing zeroes (although I imagine that if I can get the solution for the first question I'll be able to figure out the second).
Thanks in advance.
EDIT: The length of the characters can change but the numbers are USUALLY 2 or more digits as well as the letters.
To isolate the first characters from the numbers, in C2 this array formula:
=MID(B2,1,MIN(IF(ISNUMBER(SEARCH({0,1,2,3,4,5,6,7,8,9},B2)),SEARCH({0,1,2,3,4,5,6,7,8,9},B2)))-1)
Being an array formula it must be confirmed with Ctrl-Shift-Enter when leaving edit mode. If done correctly then Excel will put {} around the formula.
If you have excel 2010 or later you can use this non CSE Formula instead of the one above. It does not require the Ctrl-Shift-Enter:
=MID(B2,1,AGGREGATE(15,6,SEARCH({0,1,2,3,4,5,6,7,8,9},B2),1)-1)
Then using that result in D2 we put:
=RIGHT(B2,LEN(B2)-LEN(C2))
This will put it in as a string, if yo want to make it a number just put -- in front:
=--RIGHT(B2,LEN(B2)-LEN(C2))
This will return the number as a number so 011 will become 11
To get the numbers
If I have a cell in which the input has to be a number, is it possible to insert some specific text in a number of consecutive columned cells somewhere else in the sheet.
I'm not sure whether this is done with a formula or another built in function.
As an example, say I have a cell E4.
If I enter the number 3 in E4, the cells F1,F2,F3 show some text. If I change the number in E4 to 6 then cells F1-F6 now display some text.
Is this at all remotely possible?
I know I would be able to to do this with multiple IF-THEN-ELSE, but is there a more efficient method?
I'll presume you are in a google-spreeadsheet and not in an excel (your tags are confusing btw)
I would do that using a hidden cell to minimize the numbers of IF statements.
Saying E4 is your numeric cell, put only one IF in F4 like
IF(E4=1;"text text2";IF(E4=2;"othertext othertext2 othertex3"; IFS... ))
So you will have the whole texts in a unique cell (I separated then by spaces but if you have spaces in your text just use a more convenient character).
Then you can do a SPLIT on G4 like
=SPLIT(F4;" ")
(or split on the character you have used).
And it will separate your data in 1, 2, 6, or how many rows you'll need for your data without having to make if statements for each row.