Nesting if error and index formulas together - indexing

I am using an index formula to pull values from a table. if the value is 0, my field show a blank. I want the field to show a "0". Can I combine and IF Error formula with an index formula, and if so, how do I do that?
I tried to nest the if error into the index formula, but with no success.

Related

Add something in a number for a column in data frame by using for loop

How to add "dash" after certain integers in a column by using for loop?
For example, number: 0550, after added dash:0-550
Here is my function for it. But once I applied, KeyError: "age" to be returned. I am stuck by using for-loop to update columns' value for a while. Thank you

How to use vba to filer a column using value from a specific cell

I want to use a macro to filter columns in a table. I want to filter for values that are higher than a value I want to put in cell, to be able to easily change the filter. Does someone have a trick for doing this with vba?
Many thanks, Bram
Record a macro whilst filtering a table on a column value. You would right click on the table column header of interest whilst recording the code and select Number_Filters > Greater Than and enter your desired number. That would give you the outline code. You can then amend the code to pick up the desired value from a specified cell. If applying filter to multiple columns record macro whilst doing this process over several columns.
Thank you for you answer. I tried this already, but I could not get the macro to pick from a specific cell. If I stored the value of the specific cell under as 'value' and put that in the outlined code, it would just do Greater Than value.. DO you have shortcut for this?
Thanks!

Find first non-blank cell in column that meets criteria in another column

I've compiled multiple spreadsheets containing sporadic employee information, and I'm now trying to consolidate all of the information to remove duplicates and blanks. The formula below is my starting point, but if the first cell that meets that criteria is blank, it returns a blank. I want it to find the next cell that meets that criteria but has a value.
=INDEX(Working!C:C,MATCH($A3,Working!$B:$B,0))
Below is what the Working tab looks like, which contains the master list of data including blanks and duplicates. Working!C:C is the list of last names; $A3 is the Employee ID I'm hoping to retrieve data for, and Working!$B:$B is the list of Employee IDs. I'll be doing this for many columns, so to illustrate this, in the table example below I've shown that Column D is the phone number. Any help you can provide is appreciated!
Column B-------C-------D
---------287-----Doe----blank
---------287-----blank---333-333-3333
---------287-----Doe----blank
Use the following array formula:
=INDEX(Working!C$1:C$100,MATCH(1,($A3 = Working!$B$1:$B$100)*(Working!C$1:C$100<>""),0))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.
Please note that with an array formula the references need to be the smallest range possible that covers the dataset.

Sorting Worksheet data by custom lists using Excel VBA

I want to sort a column in a sheet using values in another column(which is in another sheet).
For example, the values are in the column are "abc", "def" and "ghi". These values are in a column of the first sheet, but the values of the column are jumbled up. I want them sorted such that the values are in the order of "abc","def" and "ghi".
I tried this for example:
Sheets("Sheet1").Columns("G").Sort key1:=Sheets("Sheet2").Range("D:D"), order1:=xlAscending, Header:=xlYes.
There is an error when I do so:
The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank.
Not sure what's the error. Need some help on this.
Instead of using a macro you can just use the below formula and get the records sorted.
=MATCH(A1,Sheet2!A:A,0)

Getting an Index/Match with a single criteria to sum its results

I am using an INDEX/MATCH to locate a facility number, then go to the appropriate column and return the first non-blank answer it receives. this is great. However, I can't figure out how to add a SUM function to this, so it will add all of the index match results, and not just stop at the first one it finds. I'd like to only use a formula, not VB. This is what my array currently looks like.
=INDEX(INDIRECT("$H"&(MATCH(M45,$B:$B,0))&":$H$10000"),MATCH(FALSE, ISBLANK(INDIRECT("$H"&(MATCH(M45,$B:$B,0))&":$H$10000")), 0))