I am using the following formula to find the last cell with data in Column AA (between AA10:AA500) from another sheet. This works great until the text is over 256 characters and then it displays nothing. Is there a way around this issue? I need to display the result even when the text is over 256 characters.
=LOOKUP(REPT("z",255),'Mail Machine QR Data'!AA10:AA500)
One workaround:
=INDEX(AA:AA,AGGREGATE(14,7,ROW(AA10:AA500)/(AA10:AA500<>""),1))
Related
I'm trying to extract a SN number from multiple types of Chromebooks with different barcode outputs. Below is a photo example.
Is it possible to make one formula to extract the serial number from all barcode types?
Here is my request. I'm wondering if the "=IF" command would work for my needs:
First search for "5CD" OR "5CG" and if its found, extract it with the trailing 7 characters. (10 total)
If "5CD" OR "5CG" are not found, search for P20 and extract it with the trailing 5 characters. (8 total)
If neither are found, keep the cell empty.
Here is a working formula but it only finds one character string.
=IFERROR(TRIM(MID(SUBSTITUTE(A2,"",REPT("",99)),MAX(1,SEARCH("5CG",SUBSTITUTE(A2,"",REPT("",99)))-0),10)),"")
I know this formula could end up very long. Thank you for any suggestions. (I'd like to not have to use multiple columns with multiple formulas if possible)
Use:
=MID(A1,MIN(FIND({"5CD","5CG","P20"},A1&"5CD5CGP20")),IF(ISNUMBER(FIND("P20",A1)),8,10))
Depending on one's version this may need to be confirmed with Ctrl-Shift-Enter instead of Enter.
In addition to the question I posted previously, (Change text length based on drop down option selected), I have another scenario where a Bank's account numbers (BANK C) are either 10 or 15 digits long. The answer to my previous question facilitated changing the text length to a range (between 10 and 15 digits) and changing the text length to exactly 12 digits, by creating a lookup table and defining the min and max values.
I was told that a different approach would be needed to change the text length to either one of two values (meaning either 10 or 15 digits), but nothing I've tried so far has worked.
As shown in the last question:
I am using the following table:
I am using the following formula in my Data Validation:
=AND(LEN(B2)<=VLOOKUP(A2,F:H,3,FALSE),LEN(B2)>=VLOOKUP(A2,F:G,2,FALSE))
VLOOKUP will only return the first line and I need it find multiple so I can test against those.
How can I go about getting this to work, while still allowing the other two ways to work?
Maybe slightly different approach as shown below. Validation rule formula seems working to me:
=NOT(ISERROR(MATCH(LEN(C3),OFFSET($G$4:$G$9,,MATCH(B3,$G$3:$I$3,0)-1),0)))
We are just checking if we can find length in specific column in the table. Possible values means all possible lengths. You can also build your table horizontally, but this will require some formula adjustments. If you want, you can either expand Range G4:G9 and G3:I3 or change it to named range, or try referencing to column and header of table - these solutions will make our validation formula flexible (when you add item to list, formula will change automatically).
I am pretty sure that it is also possible to simplify that formula.
I'm sorry for cutting row numbers in the screenshot.
The following formula worked for me:
=IF(AND(ISNUMBER(SEARCH(1, A4)), AND(LEN(B4)>MIN(9), LEN(B4)<MAX(16))), TRUE, IF(AND(ISNUMBER(SEARCH(2, A4)), LEN(B4)=12), TRUE, IF(AND(ISNUMBER(SEARCH(3, A4)), OR(LEN(B4)=10, LEN(B4)=15)), TRUE,FALSE)))
So basically if "1" is found in cell A4, where the drop-down list of all the bank names is, it will only allow between 10 and 15 characters to be entered into cell B4 (where i'm inputting the bank account number). If "2" is found in cell A4, it will only allow 12 characters to be entered and if "3" is found in cell A4, only 10 OR 15 characters can be entered. Thanks for the replies though everyone.
I have two columns of cells that have irregularly formatted addresses.
I need:
1) just the zip codes to be copied into a new column;
2) the rows that do not contain zip codes to be either highlighted or empty so that I can easily identify which ones are missing.
This seems like it would be simple to do, but I can't figure out how to have Excel just find all instances of 5 consecutive numbers. Currently they are formatted as text so that the zero's are displayed. Any help greatly appreciated.
Here's what it would be to start with:
Here's what it would look like when done (highlighting optional):
You don't have Regular Expression in normal Excel. You would have to go into VBA to do that. However, for your case, there's an easy pattern: notice how the zip code is after the last space, and it's always 5 digits long? The challenge then become finding the index of this last space and extract the 5 characters that follow it. It will be clearer if you split them into 2 formula
// C3 (index of last space character):
=FIND("|",SUBSTITUTE(B3," ","|",LEN(B3)-LEN(SUBSTITUTE(B3," ",""))))
// D3, the 5 characters after that.
// Return an empty string if the address doesn't match the pattern
=IFERROR(MID(B3,C3+1,5),"")
Another approach to what Zoff Dino wrote is to break it out a bit as shown below:
In cell C3 enter the formula you see in the formula bar
Drag that down the row set and over 1 column (so it runs for column B as well)
In column use this formula: =IF(AND(C3="",D3=""),"",IF(C3="",D3,C3)) and drag it down.
This will account for all possible situations you have shown and not error out on you (unless other patterns emerge).
You can then use conditional formatting to highlight the rows with no zip code as shown in the picture:
In Excel 2010 I'm using =LOOKUP to place text in a cell dependent on the value of the cell being looked up. Short text strings work, but longer text strings cause a formula error. Here's the formula:
=LOOKUP(B58,{0,0;40,"TextA";100,"TextB";125,"TextC";145,"TextD";165,"TextE";200,""})
which works correctly and displays TextA or TextB etc. depending on the value in B58. However I want the LOOKUP to show a lot of text such as:
=LOOKUP(B58,{0,0;40,"Lots of text in here";100,"TextB";125,"TextC";145,"TextD";165,"TextE";200,""})
where the "Lots of text in here" is 432 characters, no punctuation but includes spaces.
So I don't really know, I'm assuming character limit.
Is there a way to adjust that LOOKUP so if the value is "whatever" it'll return text stored in a cell elsewhere on the worksheet?
It is usually easier to place the lookup table itself in an area of cells in the sheet, or another worksheet.
Then your lookup formula can reference cells in the worksheet without the need for a large formula to be typed out.
See here for more info, specifically example 1.
It gives better control over your lookup list, and you can easily change this when required.
There is a restriction on the size of the formula text set at 8192 characters, as specified in the table here.
Hope this helps.
Excel does have a warning (and, for a change, helpful advice!):
Instead of "Lots of text in here" something like "Lots of text"&" in here" with the & around the half-way mark should serve.
I really tried a LOT with in-built functions and also with google search but none of the ways doesn't worked out for expected result.
My exact problem is:
I've few numeric columns which i got from a website and copied directly into excel.
In those columns there is a SINGLE Leading space at the beginning of each number in the cell of the entire column. Example 523946.00. In this number there is a single space before the digit 5.
I tried a lot with TRIM and SUBSTITUTE in-built functions but nothing able to resolve my problem of removing spaces.
And also my expectation is when i select two or multiple cells in the same column(spaces removed) then automatically Excel should show or display the AVERAGE: <Average value> SUM: <total Sum> COUNT: <count value> at the below status bar or bottom ribbon.
Say, AVERAGE: 175.49 COUNT: 2 SUM: 350.98
This type of information is not showing at the bottom. Only i'm able to see COUNT: 2 alone....why?
I want in General Format only. No any special formats.
I'm using MS Excel 2013
Edit:
You can actually just use find and replace.
Copy one of the trouble cells.
Select all the cells containing non break space, and select find and replace.
Paste the copied cell into the find bar, delete everything but the last character (asuming that is the non breaking space).
Leave the replace bar empty and press replace all.
This removes all non breaking spaces. :)
**Old Solution:**You can add nothing with paste special to the whole column where the spaces occur.
First copy an completely empty cell. (! remember this step)
Then select all cells in the column and right click and select paste special.
Then select "add" almost at the bottom (see picture) and press ok.
This will make excel reevaluate the values as if you had modified in and entered the value manually. Excel then correctly converts them to numbers. :)
First make sure you have the column Formatted as you would like. Make sure it is a number with 2 decimal places (or how ever many you need), then also make sure that there is no Indents (Maybe you think the Indent is a space?) And that you have it Aligned to the Left, Or where you want the Data To be. This alone should take care of your issue.
If that doesn't work here a list of possible solutions.
=Value(Trim(A1)) ' Removes all white space before and after the text in A1
=Value(Clean(A1)) 'Removes all non printable Charactersin A1
=Value(SUBSTITUTE(I3," ","")) 'Substitutes(Replaces) all instances of " "(Space) with ""(nothing)
'****Note: With Substitute you can also specify how many
' Substitutes(Replaces) to make of the value
=Value(SUBSTITUTE(I3," ","",1)) ' Same as above but with only remove the FIRST space
=Value(Trim(Clean(A1))) ' Removes all white space before and after the text
' after removing all Non-Printable Characters
=Value(Trim(Clean(Substitute(A1," ","")))) ' Removes all white space before and after the
'after removing all Non-Printable Characters
' And after replaceing all spaces with nothing
=Value(Right(A1, Len(A1)-1)) ' This takes the End of your text by the number of characters
' in the value Except the First (In your case should be the Space)
=Value(SUBSTITUTE(I6,CHAR(160),"")) 'To help with the non breaking spaces also.
If nothing works could you please share Why you would like to remove the space? As in what you are trying to do with the data? As maybe that will open more solutions
With Ole Henrik Skogstrøm's Suggestion added Value around the functions to get the result as a value.
It may be Excel is treating your cells as text data. Is the fun Green Triangle present?
This is a common problem in excel. Forcing numeric is easier than text. Just format a column as number or General and then put in the function value() into the cells.
Things can be cleaned up from there with Copy/Paste Special values and then remove the original column.
Using Excel 2007
brettdj answered this for me. This is what worked for me and it was SIMPLE!!
To remove the CHAR(160) directly without a workaround formula go to
Find & Replace
in the Find What hold ALT and type 0160 using the numeric keypad
then Leave Replace With as blank and select Replace All
In your case, since you always have a string of numbers, where you want to remove just the first character (a space), this formula should work:
=RIGHT(A1,LEN(A1)-1)
The numbers can vary in length, important is only, that you want to remove just 1, (or 2, or 3 etc) characters. It will still work. {If you had 2 empty spaces in front, then you would use in the formula -2, if three -3, etc)
However, if you had always a different amount of blanks in your string of numbers, like I had, you could use this formula, which worked for me:
=VALUE(SUBSTITUTE(TRIM(A1),CHAR(160),""))
,assuming that the issue you are facing is code "160".
That you can find by typing: =code(A1), which in my case gave me the result "160". Therefore char(160) in the formula above.