20/11/2022 12:00:52 2 X 15.95 15.95 USD 57 5 689 5 689 1 4111 0 Amazing Lego Team
I need to get the position of No 4111 in the above text string, As an excel beginner any help will be greatly appreciated. Thanks.
All of the Text Strings will have a 4 digit number like 4111 which i have to get the position for.
Have tried using this formula to get four digit number in another column, LOOKUP(10^15,MID(A1,ROW(INDIRECT("1:"&LEN(A1))),5)+0) but I am looking to get position instead.
I have tried using lookup but I could only go so far as a beginner.
Use the formula you provided =LOOKUP(10^15,MID(A1,ROW(INDIRECT("1:"&LEN(A1))),5)+0) to identify the number, and use FIND to get the position of the number.
Cell A1="20/11/2022 12:00:52 2 X 15.95 15.95 USD 57 5 689 5 689 1 4111 0 Amazing Lego Team"
=FIND(LOOKUP(10^15,MID(A1,ROW(INDIRECT("1:"&LEN(A1))),5)+0),A1)
=58
This looks to be in a space (or some other character) delimited text string. If you have a bunch of rows of data like this, use the Text to Columns feature on the Data tab. Use the Delimited option and then click the check box next to space (or other if it's something custom not in the available options) and Excel will split the data into columns for you.
For your string example, if you know that your 4 digit is started 58 char from the beginning of the string, use =MID(A1,58,4) A1 is the cell with your string.
MID function returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify.
=LET(t,TEXTSPLIT(A1,," "),
FIND(FILTER(t,(LEN(t)=4)*(ISNUMBER(--(t)))),A1))
It splits the string at every space and filters the result for being of length of 4 characters and not being an error if converted to number.
Here's the case I have a column with a number of text strings. Each string contains either a single or double-digit number followed by either an "x" or the words " set" or " rounds." I'm trying to extract the numbers preceding the "x" or the words. Here's an example:
string
Desired Outcome
jump 3x10
3
push 10x3
10
pull 3 sets 10 times
3
pull 3 rounds 8 times
3
push 10 times 3 sets
3
I've tried FIND, SEARCH, {1,2,3,4, 5, 6,7, 8, 9} only to over-complicate this. There has to be a simple way to locate these combinations (##&"x", "## sets" or ""## rounds") and extract the related numbers.
Assume "String" data housed in Column A1:A6 with header.
In "Outcome" B2, formula copied down :
=LOOKUP(9^9,0+RIGHT(LEFT(A2,MIN(SEARCH({"x"," sets"," rounds"},A2&"x sets rounds"))-1),ROW(A$1:A$250)))
I'm trying to make an awesome excel document with the new excel.
I'm fairly new to the process but love the functions and find it relatively to use.
However, I'm trying to find an essay way to convert any number (e.g, 555555, 1111111) into the number of digits that are in that number (e.g., 555555 -> 6 or 11 -> 2 or 1111111111 -> 10).
Is this possible?
Thank you!
You can get the number of digits using the LEN() function
E.G. LEN(555555) = 6 AND LEN(11) = 2 AND LEN(1111111111) = 10
If you are referencing a cell E.G. cell A1 , then LEN(A1) will return the result as above depending on the value in the cell.
I have a list of results that may return a decimal value between 0 and 5. For business purposes I need to force Excel to replace the number as follows:
Any decimal value between 0 and 1 needs to show as the whole number 0
Any decimal value between 1 and 2 needs to show as the whole number 1
Any decimal value between 2 and 3 needs to show as the whole number 2
Any decimal value between 3 and 4 needs to show as the whole number 3
Any decimal value between 4 and 4.5needs to show as the whole number 4
Any decimal value between 4.5 and 5 needs to show the actual decimal value.
So, if the decimal value is 1.5, I want Excel to show it in the cell as 1. Or, if the decimal value is 4.5, I want excel to show it as 4.5.
I've tried using the following nested IF function (in this example the number to replaces is in cell L28):
=IF(L28>=4.5,L28,IF(L28<4.5>=4,"4",IF(L28=4,"4",IF(L28<4>=3,"3",IF(L28<2>=1,"2",IF(L28<1>=0,"0"))))))
However for some reason it works on values 4 or greater, but for anything <4 still shows 4, and I can't figure out why.
Should I be doing this in VBA instead?
Thanks in advance, and I'm hoping I explained this clearly...
This is why the FLOOR() function exists.
=IF(A1<=4.5,FLOOR(A1, 1),A1)
I need to be able to search my whole table for a row that matches multiple criteria. We use a program that outputs data in the form of a .csv file. It has rows that separate sets of data, each of these headers don't have any columns that are unique in of them self but if i searched the table for multiple values i should be able to pinpoint each header row. I know i can use Application.WorksheetFunction.Match to return a row on a single criteria but i need to search on two three or four criteria.
In pseudo-code it would be something like this:
Return row number were column A = bill & column B = Woods & column C = some other data
We need to work with arrays:
There are 2 kinds of arrays:
numeric {1,0,1,1,1,0,0,1}
boolean {TRUE,FALSE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE}
to convert between them we can use:
MATCH function
MATCH(1,{1,0,1,1,1,0,0,1},0) -> will result {TRUE,FALSE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE}
simple multiplication
{TRUE,FALSE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE}*{TRUE,FALSE,TRUE,TRUE,TRUE,FALSE,FALSE,TRUE} -> will result {1,0,1,1,1,0,0,1}
you can can check an array in the match function, entering it like in the picture below, be warned that MATCH function WILL TREAT AN ARRAY AS AN "OR" FUNCTION (one match will result in true
ie:
MATCH(1,{1,0,1,1,1,0,0,1},0)=TRUE
, YOU MUST CTR+SHIFT+ENTER !!! FOR IT TO GIVE AN ARRAY BACK!!!
in the example below i show that i want to sum the hours of all the employees except the admin per case
we have 2 options, the long simple way, the complicated fast way:
long simple way
D2=SUMPRODUCT(C2:C9,(A2=A2:A9)*("admin"<>B2:B9)) <<- SUMPRODUCT makes a multiplication
basically A1={2,3,11,3,2,4,5,6}*{0,1,1,0,0,0,0,0} (IT MUST BE A NUMERIC ARRAY TO THE RIGHT IN SUMPRODUCT!!!)
ie: A1=2*0+3*1+11*1+3*0+2*0+4*0+5*0+6*0
this causes a problem because if you drag the cell to autocomplete the rest of the cells, it will edit the lower and higher values of
ie: D9=SUMPRODUCT(C9:C16,(A9=A9:A16)*("admin"<>B9:B16)), which is out of bounds
same as the above if you have a table and want to view the results in a diferent order
the fast complicated way
D3=SUMPRODUCT(INDIRECT("c2:c9"),(A3=INDIRECT("a2:a9"))*("admin"<>INDIRECT("b2:b9")))
it's the same, except that INDIRECT was used on the cells that we want not be modified when autocompleting or table reorderings
be warned that INDIRECT sometimes give VOLATILE ERROR,i recommend not using it on a single cell or using it only once in an array
f* c* i cant post pictures :(
table is:
case emplyee hours totalHoursPerCaseWithoutAdmin
1 admin 2 14
1 him 3 14
1 her 11 14
2 him 3 5
2 her 2 5
3 you 4 10
3 admin 5 10
3 her 6 10
and for the functions to check the arrays, open the insert function button (it looks like and fx) then doubleclick MATCH and then if you enter inside the Lookup_array a value like
A2=A2:A9 for our example it will give {TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE} that is because only the first 3 lines are from case=1
Something like this?
Assuming that you data in in A1:C20
I am looking for "Bill" in A, "Woods" in B and "some other data" in C
Change as applicable
=IF(INDEX(A1:A20,MATCH("Bill",A1:A20,0),1)="Bill",IF(INDEX(B1:B20,MATCH("Woods",B1:B20,0),1)="Woods",IF(INDEX(C1:C20,MATCH("some other data",C1:C20,0),1)="some other data",MATCH("Bill",A1:A20,0),"Not Found")))
SNAPSHOT
I would use this array* formula (for three criteria):
=MATCH(1,((Range1=Criterion1)*(Range2=Criterion2)*(Range3=Criterion3)),0)
*commit with Ctrl+Shift+Enter