Return cell content in a different column on COUNTIF match

tjreeddoc

New Member
Joined
Nov 2, 2016
Messages
14
All,

I need a little help. I have a spreadsheet. In Column E (Capacity MB) it list the size of a virtual disk drive. I used the following formula to find all the disk drives greater than or equal to 300,000

=COUNTIF(E2:E373,">=300,000")

This returned 10 matches. That is great! Now, I need to know the name of the VM which has a disk greater than 300,000. The name of the VM is listed in Column A. But, I don’t know how to find the that information using a function. Help!

Thank you,

tjreeddoc
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
If I understand you properly, see if you can adapt this to your needs...
A​
B​
C​
D​
E​
1​
namesize
40​
2​
aa
10​
ff
40​
3​
bb
20​
hh
40​
4​
cc
30​
ii
50​
5​
dd
20​
jj
60​
6​
ee
30​
7​
ff
40​
8​
gg
30​
9​
hh
40​
10​
ii
50​
11​
jj
60​
D1 would be your criteria
D2=IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$11>=$D$1,ROW($A$2:$A$11)),ROWS($A$1:A1))),"")
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself.
Copy down as needed, then copy across
 
Upvote 0
Ford,

Thank you for the quick reply!

With your help, I am almost there!

I took your sample data and tested in a Excel 2016 MSO (16.0.7329.1051) 32-Bit.
Following is the formula I used:
=IFERROR(INDEX(A:A,SMALL(IF($D$2:$D$11>="150",ROW($A$2:$A$11)),ROWS($A$1:A1))),"")

And, I used Ctrl+Shift+Enter to convert the formula to an Array.

Here is an HTML paste of my test spreadsheet:

namesize
aaa1040
bba20bbd
cca3070
dda40ccd
eea50110
ffa70ffd
gga80150
hha90hhd
iia100190
jja110jjd
name >=150bba

<colgroup><col><col span="4"></colgroup><tbody>
</tbody>


While the formula kind of worked, it only found one cell in the criteria that was above or equal to 150.
It returned the content of Cell A3 (bba). This is not exactly what I am looking for.

I was expecting the formula to:
1. Search through D2 through D11
2. Find all Cells in D2 through D11 which have a value above or equal to 150. (There are two Cells between D2 and D11 which are greater than or equal to 150.)
3. Return the content of corresponding Cells in Column A. (Cell A8 (gga) and Cell A10 (iia))

Any thoughts?

TJ
 
Last edited:
Upvote 0
You need to remove the "" from the 150, that is making it text
I think there is more than that as all the text values in column D will also meet the >=150 criteria.

@tjreeddoc
Here is another version that you could try. This does not require the array entry.


Book1
ABCDEF
1namesize
2aaa1040gga
3bba20bbdiia
4cca3070
5dda40ccd
6eea50110
7ffa70ffd
8gga80150
9hha90hhd
10iia100190
11jja110jjd
List
Cell Formulas
RangeFormula
F2=IFERROR(INDEX(A$2:A$11,AGGREGATE(15,6,(ROW(D$2:D$11)-ROW(D$2)+1)/(D$2:D$11+0>=150),ROWS(F$2:F2))),"")
 
Upvote 0
Ford,

Thanks for the suggestion of removing "" from 150. However, that suggestion did not work. It still returns the content of Cell A3 (bba).

T.J.
 
Upvote 0
Peter_SSs

Thank you for jumping in this Thread!

I tried your formula.

1. It did search D2 – D11
2. It found only one cell (D8) with a value greater than or equal to 150.
3. It returned the content of the corresponding cell in Column A. Cell A8 which has the content of gga

However, it did not continue to search D2 – D11. The criteria has two cells with a value greater than or equal to 150; Cell D8 (150) and D10 (190).

Any thoughts on getting the formula to search all the criteria, finding all cells greater than or equal to 150, and returning all corresponding cells from Column A?

namesize
aaa1040 aaf
bba20bbdbbf
cca3070ccf
dda40ccdddf
eea50110eef
ffa70ffdfff
gga80150ggf
hha90hhdhhf
iia100190iif
jja110jjdjjf
name >=150bba
gga

<colgroup><col><col span="5"></colgroup><tbody>
</tbody>

T.J.
 
Upvote 0
This seems to work, based on Pete's example data
=IFERROR(INDEX(A:A,SMALL(IF((ISNUMBER($D$2:$D$11))*($D$2:$D$11>=150),ROW($A$2:$A$11)),ROWS($A$1:A1))),"")
ARRAY entered
 
Upvote 0
Ford,

Thanks again for the post.

Once you changed Peter's example, were you able to search and find both values greater than 150?
When I tried your change to Peter's example, it still only found the Cell D8 (150). It still does not find Cell D10 (190).
And yes, I entered =IFERROR(INDEX(A:A,SMALL(IF((ISNUMBER($D$2:$D$11))*($D$2:$D$11>=150),ROW($A$2:$A$11)),ROWS($A$1:A1))),"") as an Array (Ctrl+Shift+Enter).

Any thoughts?

T.J.
 
Upvote 0
Yes I was able to find the 2 entries, I added an extra row, just to test it again
A​
B​
C​
D​
E​
F​
1​
name
size​
2​
aaa
10​
40​
gga
3​
bba
20​
bbd
iia
4​
cca
30​
70​
aaaa
5​
dda
40​
ccd
6​
eea
50​
110​
7​
ffa
70​
ffd
8​
gga
80​
150​
9​
hha
90​
hhd
10​
iia
100​
190​
11​
jja
110​
jjd
12​
aaaa
120​
175​
F2=IFERROR(INDEX(A:A,SMALL(IF((ISNUMBER($D$2:$D$12))*($D$2:$D$12>=150),ROW($A$2:$A$12)),ROWS($A$1:A1))),"")
CSE
copy down
I see no difference between your formula and mine (other than I increased my range by 1)
Mine=IFERROR(INDEX(A:A,SMALL(IF((ISNUMBER($D$2:$D$12))*($D$2:$D$12>=150),ROW($A$2:$A$12)),ROWS($A$1:A1))),"")
Yours=IFERROR(INDEX(A:A,SMALL(IF((ISNUMBER($D$2:$D$11))*($D$2:$D$11>=150),ROW($A$2:$A$11)),ROWS($A$1:A1))),"")
 
Upvote 0

Forum statistics

Threads
1,215,537
Messages
6,125,389
Members
449,222
Latest member
taner zz

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
Back
Top