Uh...can this be done?

christianbiker

Active Member
Joined
Feb 3, 2006
Messages
360
Greetings all,

The following formula works great using one column, however is it possible to use it with multiple columns. Here is my current formula:
=IF(COUNTIF(DATABASE!$J$1:$J$500,"Active")>=ROWS($1:1),INDEX(DATABASE!$A$1:$A$500,SMALL(IF(DATABASE!$J$1:$J$500="Active",ROW($1:$500)),ROW(1:1))),"")

Here is what I tried, but couldn't get to work:
=IF(COUNTIF(and(DATABASE!$J$1:$J$500,"Active",DATABASE!$K$1:$K$500,"Yes")>=ROWS($1:1),INDEX(DATABASE!$A$1:$A$500,SMALL(IF(and(DATABASE!$J$1:$J$500="Active",DATABASE!$K$1:$K$500,"Yes"),ROW($1:$500)),ROW(1:1))),"")

I thought this would work more like a sumproduct formula however I am using text, not numbers.

Any assistance would be appreciated...

Chad
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Use multiplication for AND:

=IF((COUNTIF(DATABASE!$J$1:$J$500,"Active")*COUNTIF(DATABASE!$K$1:$K$500,"Yes"))>=ROWS($1:1),INDEX(DATABASE!$A$1:$A$500,SMALL(IF(((DATABASE!$J$1:$J$500="Active")*(DATABASE!$K$1:$K$500="Yes")),ROW($1:$500)),ROW(1:1))),"")

confirmed with Ctrl+Shift+Enter.
 

sijpie

Well-known Member
Joined
Nov 1, 2008
Messages
3,734
Your logic is all wrong in your formula..
The and() formula is first being evaluated between the 4 items in its brackets.Not what you intend to do at all.
 

xld

Banned
Joined
Feb 8, 2003
Messages
5,378
TRy this

=IF(ISERROR(SMALL(IF((DATABASE!$J$1:$J$50="Active")*(DATABASE!$K$1:$K$50="Yes"),ROW($1:$50)),ROW(A1))),"",
INDEX(DATABASE!$A$1:$A$500,SMALL(IF((DATABASE!$J$1:$J$50="Active")*(DATABASE!$K$1:$K$50="Yes"),ROW($1:$50)),ROW(A1))))
 

christianbiker

Active Member
Joined
Feb 3, 2006
Messages
360
Andrew & xld:
Thanks for your assistance. Both formulas worked. I definitely wouldn't have figured that out.

I am sure glad there is a forum such as this that provides real assistance!



sijpie:
Gee...Thanks for the insight, or lack thereof...

If I was getting the intended result I wouldn't be here asking for help would I? My logic is based on my limited knowledge of Excel and I couldn't figure it out.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,514
Messages
5,596,611
Members
414,080
Latest member
penguin23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top