Extract Values that meet criteria

cgrulk

New Member
Joined
Jun 16, 2020
Messages
10
Office Version
  1. 2016
Platform
  1. Windows
Hello All,

I am trying to extract some data from one sheet into another based on two different criteria. I need to select the data from the last six months and where column C = 1. So far I have been using an Index and small function. I have been able to extract some data, but not the correct data. I think that my logical tests are correct, but I have an error with the ROW parts of my formula that are returning the incorrect rows. So far my formula only returns one data point which is the value that is first in the data column (G2). Here is my formula so far
{=INDEX('Water Activity '!$G$2:$G$100,SMALL(IF(AND('Water Activity '!$B$2:$B$100>=(TODAY()-183),'Water Activity '!$C$2:$C$100=1),ROW('Water Activity '!$G$2:$G$100)),ROW(1:1)))}

All Help Greatly appreciated!
 

Attachments

  • 1.PNG
    1.PNG
    8.2 KB · Views: 7
  • 2.PNG
    2.PNG
    4 KB · Views: 7

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,873
Hi

You cannot use AND() in array formulas. Replace it with a multiplication, like instead of

... IF(AND('Water Activity '!$B$2:$B$100>=(TODAY()-183),'Water Activity '!$C$2:$C$100=1), ...

try

... IF(('Water Activity '!$B$2:$B$100>=(TODAY()-183))*('Water Activity '!$C$2:$C$100=1), ...
 

Watch MrExcel Video

Forum statistics

Threads
1,118,206
Messages
5,570,896
Members
412,345
Latest member
avelraza
Top