Search code examples
excelexcel-formulaexcel-tables

Excel Referencing


I am trying to compare a value (for example if D4 >= 10) and if this is true have it pull the data in the column. This is to pass information from one table to another in the same excel sheet. For some reason I cannot seem to do this for a whole range of cells without having a lot of empty space. I tried a very basic formula which works but leaves a bunch of cells empty. This formula is the following:

=IF(D4>=10, C4, "").

I tried VLOOKUPS and many other referencing formulas like INDEX but cant seem to make it work with the if condition. I know this is a very basic question but was wondering if anyone can help me out with that.

Just to be clear what I am trying to do is to pull the data in the C column if the values in the D column are greater than or equal to 10. This is from one table to another in the same sheet but without any empty cells. So that it pulls all the values in the C column when the D column has a value of 10 or more in a list.

Thank you in advance.


Solution

  • Updated based on clarified question:

    You need to add a column that does this - let's say it's column F, so the formula in F1 is:

    =IF(AND(D1 >= 10, ISNUMBER(D1)), C1, "")
    

    Enter this into the first cell of your target location, then click in the formula bar and press Ctrl + Shift + Enter to enter it:

    =IFERROR(INDEX(F:F,SMALL(IF($F$1:$F$15 <> "",ROW($F$1:$F$15)),ROW()-ROW($F$1)+1)),"")
    

    Then drag that cell down to fill the columns you want.