Can I nest the IF or any other function inside of the FILTER function to return maybe 1 instead of GBP in column J and return LON instead of LONDON in column B?
Can I nest the IF function inside of the Filter Function?
480 Views Asked by Ilyas Esa At
1
There are 1 best solutions below
Related Questions in EXCEL
- Concatenate excel cell string within cell reference string
- Use hidden information for filtering data
- Using Vlookup in Excel sheet to match substring
- Import from api into multiple excel cells
- Loop through list of files and open them
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Loop with equation for upper limit
- excel vba null value in array
- Why is my xml file having these after convert from excel?
- TextToColumns function uses wrong delimiter
- Difference between two dates in excel 2013
- Concatenate string and number as number
- Why in a pivot the "include new items in manual filter" option is grey out when source is a powerpivot?
- Count Unique Values Repeated Dates
- How do I extract info from crunchbase
Related Questions in IF-STATEMENT
- If...Then...Else Visual Basic 2012
- Why does compiler recognize while(true) at compile time but not if(true)
- Swift 2 - Pattern matching in "if"
- How to get a text to display on vba when a button is pressed?
- PHP statements with <<<EOF string
- Convert string to variable in PHP
- Are the conditional statements if(true) and if(false) evaluated at compile time in java?
- Compare strings using ==
- SQL Several Count
- how to get user to pick inputs Java
- WHERE Clause in SQL statement with 2 conditions
- PHP: most efficient way of structuring IF clauses
- Python - Why is my else statement being ignored in this piece of code?
- Multiple conditions in Java
- C program treats an if statement as false when it is in fact true
Related Questions in EXCEL-FORMULA
- Concatenate excel cell string within cell reference string
- Use hidden information for filtering data
- Using Vlookup in Excel sheet to match substring
- Find Partial Matching data across two sheets
- Nesting IF and OR statements
- is there a shortcut to open filter>contains box in excel?
- Excel Conditional Formatting: If TableColumn = value1 AND ValueFromSameRowButAnotherColumn = value2
- Excel formula to count how many times work was carried out on a weekend between the hours of 17:00 and 19:00
- Excel Formula - IF & "X" > 0
- Excel search and match two cells in the same row for multiple rows
- Ranking with subsets
- Excel with AND, IF, MAX
- Excel time sheets
- sumifs on excel linked sql server query with date
- Determine longest date range, from two date ranges - Excel
Related Questions in FILTERFUNCTION
- Pass parameter to filter function in Spry framework?
- Can I nest the IF function inside of the Filter Function?
- How to pass a list of variable conditions to a filter function, instead of a single condition, in python?
- Filter function for wordpress seo title
- python filter function with arguments
- Legacy Values Left In Google Sheets
- Filter divs based on text input
- Best way to handle copy down of formulas adjacent to filter arrays in excel
- DAX Multiple filters across multiple columns to produce new table
- Use filter to return the words from a list of words which start with a target letter
- about filter in R
- writing filter function using foldr?
- p:datatable filter does not work right anymore after update 7.0 to 8.0
- How to achieve python's any() with a custom predicate?
- How to use apply in a filter function
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As per our discussion in the comments above, it would be more efficient to manipulate the results of the
FILTER()function by nesting it inside of another function, rather than attempting to manipulate the entire data set. One such function that would work in this situation is theSWITCH()function:SWITCH()looks at each value in the filtered array and replaces any matching values found with their corresponding results. Matching values and results are entered in pairs and can include up to 126 pairs in total. The final optional argument is the default value to be returned if no match is found, which in this case is the original value present in the filtered array. Also,SWITCH()only performs an exact match, so you can't use wildcards or comparison operators.The above-mentioned formula is the quick and easy method, which works with the sample data you provided; however, it could be prone to errors if "GBP" and/or "LONDON" are present in more than one column. Furthermore, if you're actual data set contains multiple city names in the "Address" column (ie: Birmingham, Glasgow, Liverpool, etc.), managing the list of values and their corresponding results within
SWITCH()can become quite cumbersome. As such, it would be more appropriate to identify the specific columns in the filtered array that you wish to manipulate and perform the applicable action on each individual column:In this example,
INDEX()was used to identify the entire "Address" column by omitting the row_num argument and setting the column_num to 2, andLEFT()was used to simply return the first 3 letters of each value. The "Currency" column was identified in the same manner with column_num 4, andSWITCH()was used to replace the currency codes with a numeric value. This method works fine if your data set only contains a limited number of currency codes. I didn't specify the final default value argument in this case, soSWITCH()will return#N/Aif a new code is present (ie: "CAD"), and you'll know the formula needs to be updated with an additional pair of values and results.HSTACK()is then used to create a new array consisting of the filtered array, plus the new "add" and "cur" columns (7 columns in total), andCHOOSECOLS()is used to replace the original column 2 with the new column 6, as well as 4 with 7. That's it!On a side note, I'm not a fan of using entire column references like
A:E,A:AandE:Eas this will significantly reduce the overall performance of the workbook (you'll likely notice a lag or hesitation when inputting new values in the referenced columns). Structured tables are ideal because the column references are dynamic and expand automatically when new records are added. However, if you prefer standard range references, I highly recommend using a reasonable number of rows that extends far enough below your existing data to allow for growth. For example: if your dealing with only a few hundred rows of data,A2:E1000,A2:A1000andE2:E1000would be adequate, and it's far more efficient thanA1:E1048576(which is whatA:Eis referencing).Cheers!