Vlookup Ignoring Hidden Values

Bugas

New Member
Joined
Sep 17, 2012
Messages
44
Office Version
  1. 2007
Platform
  1. Windows
Sometimes my data is hidden and I need to get the values. I don't know how to use SUBTOTAL with a VLOOKUP or IF statement, otherwise it would be easy.

I'm trying to get only the visible scores for different players.


[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD]Aaron[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]Bruce[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]Charlie[/TD]
[TD]15[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]Aaron[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD]Danny[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD]Aaron[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD]Aaron[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD]Freddie[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD]Aaron[/TD]
[TD]10 / 25 / 30 / 20[/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


For instance, in the following table for Aaron (A10) I get these results (B10): 10 / 25 / 30 / 20. With a VLOOKUP it would be easy.

However, I need to hide columns 1, 2, 3 and 4. Then for Aaron in this case I would get 30 / 20. For Bruce it would be "".

Without using VBA is there any chance to do it?

Thanks :)
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Can the results be returned in separate cells? If so, try...


Excel 2010
ABCDEFGHIJ
5Danny10
6Aaron30
7Aaron20
8Freddie30
9
10Aaron23020
Sheet1


B10, confirmed with CONTROL+SHIFT+ENTER...

=SUM(IF(SUBTOTAL(103,OFFSET($A$1:$A$8,ROW($A$1:$A$8)-ROW($A$1),0,1))>0,IF($A$1:$A$8=$A10,1)))

C10, confirmed with CONTROL+SHIFT+ENTER, and copied across:

=IF(COLUMNS($C10:C10)<=$B$10,INDEX($B$1:$B$8,SMALL(IF(SUBTOTAL(103,OFFSET($A$1:$A$8,ROW($A$1:$A$8)-ROW($A$1),0,1))>0,IF($A$1:$A$8=$A10,ROW($A$1:$A$8)-ROW($A$1)+1)),COLUMNS($C10:C10))),"")

Note that in addition to manually hidden rows, filtered data will also be reflected in the results.

Hope this helps!
 
Last edited:
Upvote 0
Thanks! It works perfect :)

Can the results be returned in separate cells? If so, try...

Excel 2010
ABCDEFGHIJ
Danny
Aaron
Aaron
Freddie
Aaron

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]5[/TD]

[TD="align: right"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]

[TD="align: right"]30[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]

[TD="align: right"]20[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]

[TD="align: right"]30[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]

[TD="align: right"]2[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]20[/TD]

[TD="align: right"][/TD]

</tbody>
Sheet1



B10, confirmed with CONTROL+SHIFT+ENTER...

=SUM(IF(SUBTOTAL(103,OFFSET($A$1:$A$8,ROW($A$1:$A$8)-ROW($A$1),0,1))>0,IF($A$1:$A$8=$A10,1)))

C10, confirmed with CONTROL+SHIFT+ENTER, and copied across:

=IF(COLUMNS($C10:C10)<=$B$10,INDEX($B$1:$B$8,SMALL(IF(SUBTOTAL(103,OFFSET($A$1:$A$8,ROW($A$1:$A$8)-ROW($A$1),0,1))>0,IF($A$1:$A$8=$A10,ROW($A$1:$A$8)-ROW($A$1)+1)),COLUMNS($C10:C10))),"")

Note that in addition to manually hidden rows, filtered data will also be reflected in the results.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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