Formula that removes values based on 3 first characters? [closed] - excel

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm asking if it's possible in excel to write a formula that
takes a cell value and get 10 values from right to left (in order to remove unwanted values as for example +58, 58, 0)
and then get the first three values in order to remove unwanted once again
For example, see the sample data below:
04145885607
04145894589
04145920307
04145930676
04145945235
04145971623
584146316092
+584146317534
00584146318088
4146337864
4146361075
4146400205
4146415696
4146416643
I need to remove in first values like +58, 58, 0 all at the start of the string
then compare the first three values and leave for example those who have 414 or 424
Is that possible in Excel?

Try
=MID(A1,FIND("414",A1),99)
Or with 424 in the mix
=MID(A1,IF(ISERROR(FIND("414",A1)),FIND("424",A1),FIND("414",A1)),99)

UPDATED
Here is a slightly more complicated formula that will work if you have both "414" and "424" mixed in the column of text strings. Note that the FIND function will also work in place of the SEARCH function in the formula.
=MID(A1,IFERROR(SEARCH("414",A1),0)+IFERROR(SEARCH("424",A1),0),99)
Another variation that will work as well:
=MID(A1,IFERROR(SEARCH("414",A1),IFERROR(SEARCH("424",A1),0)),99)
An interesting alternative that works if you have a list of values that could be a match is the following array formula:
=MID(A1,MIN(IFERROR(SEARCH($D$1:$D$3,A1),99)),99)
To use it, you set up a list of the values to look for (I used cells D1:D3 as shown below) and then reference that list in the SEARCH (or FIND) function. As an array formula, it needs to be entered with the Control-Shift-Enter key combination.
All of these formulas return a #VALUE! error if the search strings are not found.

Related

Return list of all values that match criteria to one or more cells [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed last month.
Improve this question
i to pick all zip codes(A:A) by city(C) and county (D)
I need to look like
is that posible? i need to remove all duplicates and get all zip codes for every county
You'd want TEXTJOIN() and FILTER(), where the 2nd parameter of FILTER() holds a boolean structure:
=TEXTJOIN(" ",FILTER(A$2:A$30,(C$2:C$30=B2)*(D$2:D$30=C2)))

Excel Summing Un-Formatted Numbers [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 months ago.
Improve this question
I'm trying to find an average of a large array of candidates compensation. Some of the cells contain text with multiple numbers showing a range such as, "$100k - $120k". Others are labeled as TC("120k TC") for total composition.
How would I be able to find the average of these numbers by using a something along the lines of substituting letters or parsing the string into a number WITHOUT changing the actual values listed? I do NOT want to mutate the original cell value of I only want to find an average of them all through a formula to bypass the additional "k", "TC" and "-" rendering them un-averageable as they are not parsed as numbers.
Would need to clean up the texts in stages.
find if a certain text is present: eg.
=IF(IFERROR(FIND("-",A1,1),"")<>"","- is present","")
=IF(IFERROR(FIND("TC",A1,1),"")<>"","TC is present","")
=IF(IFERROR(FIND("$",A1,1),"")<>"","$ is present","")
then split left and right price values if "-" is present: eg.
=LEFT(A1,FIND("-",A1,1))
=RIGHT(A1,FIND("-",A1,1))
then if texts are present, remove those texts: eg.
=SUBSTITUTE(A1,"-","")
=SUBSTITUTE(A1,"$","")
=SUBSTITUTE(A1,"k","")
then can use trim() to remove spaces on ends, value() to convert text to number etc...

Assign a unique integer to an alphanumeric string in excel [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have data of order 4096*2 in excel. Second column contains all alphanumeric values of the kind 10ABC1101, 10CDE1101 and 20FGH2345. I am looking for a method (using Excel functions only and not VBA) to assign a unique integer value to each alphanumeric value in column 2.
Plan is to take data into Matlab for some analysis (and avoid String handling within Matrices) and bring it back to Excel and convert integers into original alphanumeric strings.
Ps: I am new to both Matlab and Excel.
Clearly separating numbers from strings will not help me because that does not assign unique value.
Many Thanks.
For non-consecutive Unique IDs you can use (in column C)
=MATCH(B:B,B:B,0)
To get the string back
=INDEX(B:B,C:C)
Note: these formulas use Implicit Intersection see here for some info

Suggestions for building and managing complex functions in Excel [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Far too often, I've got a formula that wraps functions inside of functions inside of functions, and when some new condition requires that I wrap another function around it, I often find myself completely losing track of which parentheses go where, which function applies to which set of parameters and usually find myself debugging a statement for a half hour after my modification produces unexpected results.
What I've BEEN doing is to cut the function into its individual parts in a column...each row representing a single function, and when I'm satisfied that end result is what it needs to be, I copy each piece back into it's respective spot in the preceding cell until I have a completed, and hopefully working, function.
CONSIDER:
=IF((ISERROR((VLOOKUP(D2,$A$2:$A9,1,0))),(IF((D2=(VLOOKUP(D2,$A$2:$A$9,1,0))),0,D2)),E2)
0 =IF((ISERROR((VLOOKUP(D2,$A$2:$A9,1,0))),L17,E2)
TRUE =ISERROR((VLOOKUP(D2,$A$2:$A9,1,0))
0 =IF((D2=L18),0,D2)
the =VLOOKUP(D2,$A$2:$A$9,1,0)
It'd be great to be able to document inline or have something similar to a VBA popup ion which to edit formulae, but since that doesn't exist, I'd be interested to know what other techniques for effectively building complex functions you've found helpful. Thoughts?
Normally, I split formulas over multiple columns - each column then contains a part of the formula. I never stuck them into a single cell - while "cleaner" they are impossible to debug.
If the columns are to much, I build a "admin" sheet, which can be hidden.
I dislike the excel formula editor in general - while I really like the power of the formulas, the editor is a pain to use.

EXCEL spreadsheet -- matrices product term by term [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have two table with figures with dimension 9*9. I would like to compute
sum(aij*bij) over j
with obvious notation with one formula only.
For now, I am first computing a 9*9 table filled with aij*bij in each cell, and then in a new column I am doing a sum over columns of values in this 9*9 table. It is two step. I would like to do that in one step to save space and time.
What is syntax ?
Thanks
You should be able to use SUMPRODUCT formulas to sum products over columns.
If your original arrays are in ranges A1:I9 and K1:S9, then the first entry in your result array would be =SUMPRODUCT(A1:I1, K1:S1). Copying this formula down for eight rows more gives you the rest of the result elements..
Summing the products over all elements would be even easier: SUMPRODUCT(A1:I9,K1:S9)
Another approach here - use array SUM formula: =SUM(A1:I1*K1:S1). However, as you type it into cell, press CTRL+SHIFT+ENTER instead of usual ENTER. As a result, this formula will be displayed as {=SUM(A1:I1*K1:S1)} - brackets indicate that this is an array formula. However, they should NOT be manually added.
#chuff answer is absolutely correct and I upvoted it, but using array formulas has at least 1 advantage: with them you may do much more magic tricks which are not / hardly implemented using SUMPRODUCT or any similar functions.
Please also see Remark section there: http://office.microsoft.com/en-001/excel-help/sumproduct-HP005209293.aspx
Use this sample file as a demo for both solutions: https://www.dropbox.com/s/0xr8iif920uqpqf/SUMPRODUCT.xlsx
Choose any solution which is more suitable for you! (:

Resources