How to filter 2 Columns with the same text

groceryguy306

New Member
Joined
May 19, 2022
Messages
20
Office Version
  1. 2013
Platform
  1. Windows
Hello

I have a spread sheet that i'm keeping track of my local sons hockey teams. How do I filter so I would be able to see the same team in both the Visitor column ( Column C in excel) and in the Home Column (Column E in excel). i've tried using a pivots table but i cant get it to function properly with text in the values field. i've tried using slicers but it only allows me to filter either Column C or E and not both at the same time. I want to be able to view the entire teams away and home games


DateVisitorGoals VHomeGoals HOTTotalOV / UDGoals
2023-10-10Contacts4Blades26Under4-2
2023-10-10Blades3Lightning58Over3-5
2023-10-11Contacts1Knights45Under1-4
2023-10-12Lightning1Blades34Under1-3
2023-10-14Knights3Contacts58Over3-5
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
is this on 2013 . as shown in profile - Filter() would work on later versions , but thats on 2021/365 versions
 
Upvote 0
You can use Advanced Filter (Data Advanced). Specify the Database range you want to filter and the criteria range

The criteria range is simply a copy of the headers from your table with 2 rows below it. If you put values in 2 fields on the same row and means AND. Putting values for 2 fields on different rows means OR.



Book11
BCDEFGHIJ
1Criteria Range
2DateVisitorGoals VHomeGoals HOTTotalOV / UDGoals
3Blades
4Blades
5
6Database
7DateVisitorGoals VHomeGoals HOTTotalOV / UDGoals
810/10/2023Contacts4Blades26Under2-Apr
910/10/2023Blades3Lightning58Over5-Mar
1110/12/2023Lightning1Blades34Under3-Jan
Sheet2
 
Upvote 0
Another option is to create tables for your data and make two copies and sort each one accordingly:

Book1
ABCDEFGHI
1DateVisitorGoals VHomeGoals HOTTotalOV / UDGoals
210/10/2023Blades3Lightning58Over5-Mar
7
8
9DateVisitorGoals VHomeGoals HOTTotalOV / UDGoals
1110/10/2023Contacts4Blades26Under2-Apr
1410/12/2023Lightning1Blades34Under3-Jan
Sheet4
 
Upvote 0
Not sure why I didn't think of this sooner, but you can add a helper column to your data and use the following formula, with the team name you are wanting to filter by in row 1 of that column:

Book1
ABCDEFGHIJ
1DateVisitorGoals VHomeGoals HOTTotalOV / UDGoalsBlades
245209Blades3Lightning58Over453561
345209Contacts4Blades26Under453841
645211Lightning1Blades34Under452941
Sheet10
Cell Formulas
RangeFormula
J2:J3,J6J2=IF(OR($B2=$J$1,$D2=$J$1),1,0)
 
Upvote 0
Solution
You can use Advanced Filter (Data Advanced). Specify the Database range you want to filter and the criteria range

The criteria range is simply a copy of the headers from your table with 2 rows below it. If you put values in 2 fields on the same row and means AND. Putting values for 2 fields on different rows means OR.

maybe i'm not putting the correct selections in each field, i cannot seem to make that work I get an error "criteria range is not valid"
 
Upvote 0
Not sure why I didn't think of this sooner, but you can add a helper column to your data and use the following formula, with the team name you are wanting to filter by in row 1 of that column:

Book1
ABCDEFGHIJ
1DateVisitorGoals VHomeGoals HOTTotalOV / UDGoalsBlades
245209Blades3Lightning58Over453561
345209Contacts4Blades26Under453841
645211Lightning1Blades34Under452941
Sheet10
Cell Formulas
RangeFormula
J2:J3,J6J2=IF(OR($B2=$J$1,$D2=$J$1),1,0)

thanks
that works perfect for what i need.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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