How to use AND, OR and Formulas with VBA Advanced Filter

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

ความคิดเห็น • 80

  • @Excelmacromastery
    @Excelmacromastery  5 ปีที่แล้ว +8

    Hi everyone,
    In this video, I show you how to unlock the power of the Advanced Filter using AND and OR in the criteria.
    If you have any questions, please leave your comments below.
    A quick guide:
    T* - all cells that start with T.
    T - all cells that start with T.
    *Y - all cells that end with Y.
    ="=Tom" - all cells that match exactly Tom.
    ="Tom" - all cells that do not match exactly Tom.

    • @johnrichmondrobles3911
      @johnrichmondrobles3911 5 ปีที่แล้ว +1

      Excel Macro Mastery can you make a video how to create an udf filter function using vba like the new array formula filter in office 365 so that the users with earlier version of office can use it too

    • @noufiyay.a8861
      @noufiyay.a8861 5 ปีที่แล้ว

      Please add examples in filtering dates.

    • @aaryanbl
      @aaryanbl 3 ปีที่แล้ว

      Thank you sir. (1:13 of this video) i want to filter just by typing (an or nn) for all Ann. From the vba code instead of typing (*?) in the cell.
      Eg: i'm using in another code for your ref
      (Field:=4, Criteria1:="*" & [A2] & "*") Which is used to filter all the matched range including before and after the search criteria.

  • @wayneedmondson1065
    @wayneedmondson1065 5 ปีที่แล้ว +2

    Hi Paul.. another useful and informative video. Learning a lot about both VBA and basic use of native Advanced Filter.. excellent! Thanks and keep them coming. Love your videos, tutorials, blog posts, web site, etc. Excel Macro Mastery is the place to go to learn it right. Thumbs up!!

    • @Excelmacromastery
      @Excelmacromastery  5 ปีที่แล้ว +1

      Thanks very much Wayne. I appreciate the feedback and support. Plenty more on the way.

  • @joaocustodio2094
    @joaocustodio2094 5 ปีที่แล้ว

    Paul, today I have watched / I reviewed some of your videos and always learned something new. Thank you very much.

  • @sasavienne
    @sasavienne 5 ปีที่แล้ว

    I really liked these videos of using the advanced filter in VBA. This tutorial is very useful and helpful. Thanks indeed Paul.

  • @buithitrami175
    @buithitrami175 5 ปีที่แล้ว +1

    Thanks for this video Paul. I’ve learned a lot from it.

  • @nullasoltanto5906
    @nullasoltanto5906 2 ปีที่แล้ว

    SUPER! MANY THANKS FOR YOUR TOPTIP

  • @ganeshs1360
    @ganeshs1360 2 ปีที่แล้ว

    very informative. In my case there are over 200 columns of data and need to filter on few columns, and the output should be generated with few specific columns and not all 200. is this possible with advanced filter?

  • @Nutflash1978
    @Nutflash1978 5 ปีที่แล้ว

    Another gem mate, keep Em coming

  • @Jack_C_
    @Jack_C_ 5 ปีที่แล้ว

    Thanks Paul, immensely useful and very well presented.
    Never new about using a formula with Advanced Filter, makes it even more powerful than I thought.
    Would love to see some advanced stuff on web scraping with VBA so I can get the data set in the first place.
    Please keep the videos coming.
    :)

    • @Excelmacromastery
      @Excelmacromastery  5 ปีที่แล้ว

      Thanks Jack. I have a web scraping application in my Excel VBA Handbook Course

  • @grahamparker7729
    @grahamparker7729 5 ปีที่แล้ว

    Just found your channel Paul. Loving it, keep up the great work 👍🏻

  • @eddai84
    @eddai84 5 ปีที่แล้ว

    Thank you so much, Paul. It's very brilliant.

  • @amarnadhg6896
    @amarnadhg6896 5 ปีที่แล้ว

    Great video, plz keep it doing regular

  • @grahamkey1861
    @grahamkey1861 4 ปีที่แล้ว

    This is great. How can I do the same thing but filter for each name in one run and paste them on top of each other, so each sales person has their own section with headers? Thanks

  • @JohnOvens
    @JohnOvens 5 ปีที่แล้ว

    Excellent Paul - the Criteria is similar to ACCESS queries.

  • @gnfielies
    @gnfielies 5 ปีที่แล้ว

    Thank you very much, an I hope to see more. You are amazing, great teaching skill.

  • @alihamiad7849
    @alihamiad7849 5 ปีที่แล้ว

    Very nice! That is what I'm looking for.

  • @Jwichern01
    @Jwichern01 5 ปีที่แล้ว

    Thank you for this very informative video.
    I am struggling to get the advanced filter to work with a date range. I tried stacking the criteria on subsequent rows, such as “>09/10/2019” then on the row below “

  • @johnsmith2771
    @johnsmith2771 3 ปีที่แล้ว

    Thank you again for the video. I am just wondering if I could ask you a question regarding Excel, What I'm trying to do is to give a value to a particular cell in a formula based on a condition being true in another cell, some thing look like this, if cell('a1')=1 then cell('a2").value = A else nothing happens. Is it possible to have this done in Excel without using VBA?

  • @imranbhatti8580
    @imranbhatti8580 5 ปีที่แล้ว

    Hey Paul nice to see you on youtube. I didn't know that you have a youtube channel. I just knew about your website.

    • @Excelmacromastery
      @Excelmacromastery  5 ปีที่แล้ว

      Thanks for finding and support my channel Imran.

  • @planxlsm
    @planxlsm 3 ปีที่แล้ว

    00:00 - Introduction
    01:06 - Using AND criteria
    01:47 - Using OR Criteria
    02:46 - Using Formulas in Criteria
    05:03 - Using Wildcards

  • @iincitr
    @iincitr 5 ปีที่แล้ว

    Thank you. What about calculated filed after adv. filter copy to another sheet. Is there any way?

    • @eiger67
      @eiger67 5 ปีที่แล้ว

      yes, just watch the previous video

  • @cuonglecanh1499
    @cuonglecanh1499 5 ปีที่แล้ว

    Hi! Thanks for your video! Can you share your excel Copy?

  • @nielskock3221
    @nielskock3221 5 ปีที่แล้ว

    Love the content, as a suggestion for another video. I would love to see how or if you can use conditional formatting in combination with Advanced filters and how that is done in VBA. To for example highlight fields that include Tom yellow and sales above 20.000 in Green etcs.

    • @Excelmacromastery
      @Excelmacromastery  5 ปีที่แล้ว

      Thanks for the suggestion Niels. I'll keep it in mind

  • @PrincePedia
    @PrincePedia 5 ปีที่แล้ว

    Thanks Paul.

  • @andrewscoins5013
    @andrewscoins5013 3 ปีที่แล้ว

    Could you Show ist how to use IT in Userform with Text or Comboboxen?

  • @ganlyb
    @ganlyb 8 หลายเดือนก่อน

    To filter between two dates, you need an AND. In the criteria range enter to columns with the name and the dates. NB tested with >01-Jan-2019, not number only dates, so American formatting may mix things up, Filter for a year
    Day Day
    >=01/01/2019

  • @preesha5815
    @preesha5815 21 วันที่ผ่านมา

    Sir, How to filter values of one row having 10 columns with many other rows having values in 25 columns.

  • @abeibrahim5846
    @abeibrahim5846 5 หลายเดือนก่อน

    how to use RegEXtext in advance search to allow searching for embedded text?

  • @raviuchil148
    @raviuchil148 4 ปีที่แล้ว

    Hi everyone,
    Great video again, thanks paul
    hope you can help me. I am using a table (ListObject) as a Advance Filter criteria range for another larger database. in this table, for the AND criteria, I wish to have two identical header names, but a "2" gets automatically added to each new duplicate header name, like so .. duplicate of "Surname" becomes "Surname2". For AND criteria to work, the header names need to be exactly the same. How do you get Excel VBA to permit duplicate header row names ?

  • @dmckay2844
    @dmckay2844 4 ปีที่แล้ว

    how would you use the "and/or" and formulas if you were using the UseAdvancedFilterCopy code?

    • @gehennnna
      @gehennnna 4 ปีที่แล้ว

      Could you figure it out?

  • @noufiyay.a8861
    @noufiyay.a8861 5 ปีที่แล้ว

    Can u show examples in filtering dates

  • @1yyymmmddd
    @1yyymmmddd 3 ปีที่แล้ว

    It looks like after some number of criteria modifications Advanced filter becomes painfully slow. Any idea why?

  • @edmerzlak16
    @edmerzlak16 4 ปีที่แล้ว

    How do you filter for a single letter stock symbol for AT&T for example is T - Thanks great videos!

  • @budiawanlie2752
    @budiawanlie2752 5 ปีที่แล้ว

    Hi Paul, thanks for the amazing and very well presented video.
    but i have a question, how to filter where the criteria are not equal to?
    I can filter using if it's a single criteria, but didn't work on multiple criteria (OR) which look like this :
    Header
    something
    something
    thanks.

    • @Excelmacromastery
      @Excelmacromastery  5 ปีที่แล้ว

      ="Tom"

    • @gahshunker
      @gahshunker 2 ปีที่แล้ว

      you need to add as a AND condition, not an OR. Like in
      Header,Header
      something,something

  • @susantakumar8330
    @susantakumar8330 5 ปีที่แล้ว

    Hi,
    It's really nice technique.. if possible can you make video on visual studio.. bcz I feel in TH-cam there is no proper content on visual studio.

    • @Excelmacromastery
      @Excelmacromastery  5 ปีที่แล้ว +2

      Thanks Susanta. I'm just focusing on VBA for the moment.

  • @rdcycles9790
    @rdcycles9790 4 ปีที่แล้ว

    Can you use this to say filter for when Tom or Ann, have quantities 5,7 or 9?
    I’m thinking if you put Tom in B2, Ann in B3. 5 in C2, 7 in C3 and 9 in C4. You’d miss the record where Ann sells 5?

    • @Excelmacromastery
      @Excelmacromastery  4 ปีที่แล้ว

      Tom 5
      Tom 7
      Tom 9
      Ann 5
      Ann 7
      Ann 9

    • @rdcycles9790
      @rdcycles9790 4 ปีที่แล้ว

      @@Excelmacromastery thank you, though this could get long quite quickly. My real life example could have 10 in one column, and 10 in another. Meaning 100 rows.

  • @katjakazmina
    @katjakazmina 5 ปีที่แล้ว

    Hi Everyone, !
    Thank you for amazing videos.
    I am struggeling with changing lists of just one criteria. Like I would apply lists to group the entries . I have created different Lists in the NameManager but struggle to run :"for i (got to this list for advFilter, next i (next list) etc.
    I am stuck.
    Thank you

  • @minhcuong7969
    @minhcuong7969 5 ปีที่แล้ว +1

    hi a thank you for sharing the channel to help me e with a

  • @markarmon2883
    @markarmon2883 4 ปีที่แล้ว

    How to filter date. If I put *2020-06 it will not work.

  • @rrrraaaacccc80
    @rrrraaaacccc80 10 หลายเดือนก่อน

    💘💯

  • @vijaysahal4556
    @vijaysahal4556 5 ปีที่แล้ว

    yours teaching way is very unique..sir thnx...today I enjoyed yours if and or topic video class there r some issue with me plz cn u hlp me ..I do watching with you product criteria range true,false graterthen 20000 but there values not change how is possible I dnt know cn u hlp me..plz if it is like you then plz make a video with excel sheet on whitout vba..
    plz

    • @Excelmacromastery
      @Excelmacromastery  5 ปีที่แล้ว

      Advanced filter applies the formula to all the row similar to how you copy a a formula to different rows.

  • @bassisessaidexcel
    @bassisessaidexcel 5 ปีที่แล้ว

    Merci

  • @robertbendkowski3385
    @robertbendkowski3385 5 ปีที่แล้ว +1

    We want moooooore.

  • @vijaysahal4556
    @vijaysahal4556 5 ปีที่แล้ว

    I m traing the advance filter but I cnt do ds like u ohk

  • @jerryjones8836
    @jerryjones8836 2 ปีที่แล้ว

    FREE CHEAT SHEET: Get the free cheat sheet on VBA arrays here: (bit.ly/2MXsnz9)-says this is for arrays (is it Adv Filter)?
    Excel VBA Copy - The Complete Guide to Copying Data: (excelmacromastery.com/excel-v...) This is a link to the Array article

    • @Excelmacromastery
      @Excelmacromastery  2 ปีที่แล้ว

      Hi Jerry, I have update the second link which was wrong. Thanks for pointing that out.
      The cheat sheet for arrays is correct. I didn't have one for Advanced filter when I created the video. You can see the quick guide here: excelmacromastery.com/vba-advanced-filter/

  • @armotxa124
    @armotxa124 4 ปีที่แล้ว +2

    ignore my message
    solution has been found