+ Reply to Thread
Results 1 to 5 of 5

Using ADD function within DCOUNT criteria

  1. #1
    DaveF2002
    Guest

    Using ADD function within DCOUNT criteria

    I am trying to use a DCOUNT function, and need to have two criteria. How do
    I use the AND function within the criteria?

    I can do it using one criteria at a time, but when I use AND to use two
    criteria, I get an error.

    What sytax do I use?

    Many thanks

  2. #2
    Earl Kiosterud
    Guest

    Re: Using ADD function within DCOUNT criteria

    Dave,

    I don't think you can, unless you set up a helper column that has your
    conditions, then use that in your DCOUNT function. Something like:
    =AND(A2>0, A2<100, B2 = "Normal").
    This one's for A2 values between 0 and 100, and B2 contains the word Normal.

    Or use SUMPRODUCT instead:
    =SUMPRODUCT( (A2:A100 > 0) * (A2:A100 < 100) * (B2:B100 = "Normal) )

    --
    Earl Kiosterud
    www.smokeylake.com/

    Off-topic: There's a hilarious comedy act by Men in Coats at
    http://www.koreus.com/files/200505/men-in-coats.html. You gotta see this.
    I had to share with all.

    -------------------------------------------

    "DaveF2002" <DaveF2002@discussions.microsoft.com> wrote in message
    news:82CFF1A2-690F-41D6-9F31-3E2F99665531@microsoft.com...
    >I am trying to use a DCOUNT function, and need to have two criteria. How
    >do
    > I use the AND function within the criteria?
    >
    > I can do it using one criteria at a time, but when I use AND to use two
    > criteria, I get an error.
    >
    > What sytax do I use?
    >
    > Many thanks




  3. #3
    Debra Dalgleish
    Guest

    Re: Using ADD function within DCOUNT criteria

    You can use two columns in the criteria area, similar to the advanced
    filter criteria area shown here:

    http://www.contextures.com/xladvfilter01.html#Criteria

    DaveF2002 wrote:
    > I am trying to use a DCOUNT function, and need to have two criteria. How do
    > I use the AND function within the criteria?
    >
    > I can do it using one criteria at a time, but when I use AND to use two
    > criteria, I get an error.
    >
    > What sytax do I use?
    >
    > Many thanks



    --
    Debra Dalgleish
    Excel FAQ, Tips & Book List
    http://www.contextures.com/tiptech.html


  4. #4
    Earl Kiosterud
    Guest

    Re: Using ADD function within DCOUNT criteria

    Dave,

    Oops. Cancel the "I don't think you can." I read your post as using
    COUNTIF, not DCOUNT. I think I'll go back to painting the guest room now.
    --
    Earl Kiosterud
    www.smokeylake.com/
    -------------------------------------------

    "Earl Kiosterud" <nothanks@nospam.com> wrote in message
    news:eVXRPhNdFHA.3712@TK2MSFTNGP12.phx.gbl...
    > Dave,
    >
    > I don't think you can, unless you set up a helper column that has your
    > conditions, then use that in your DCOUNT function. Something like:
    > =AND(A2>0, A2<100, B2 = "Normal").
    > This one's for A2 values between 0 and 100, and B2 contains the word
    > Normal.
    >
    > Or use SUMPRODUCT instead:
    > =SUMPRODUCT( (A2:A100 > 0) * (A2:A100 < 100) * (B2:B100 = "Normal) )
    >
    > --
    > Earl Kiosterud
    > www.smokeylake.com/
    >
    > Off-topic: There's a hilarious comedy act by Men in Coats at
    > http://www.koreus.com/files/200505/men-in-coats.html. You gotta see this.
    > I had to share with all.
    >
    > -------------------------------------------
    >
    > "DaveF2002" <DaveF2002@discussions.microsoft.com> wrote in message
    > news:82CFF1A2-690F-41D6-9F31-3E2F99665531@microsoft.com...
    >>I am trying to use a DCOUNT function, and need to have two criteria. How
    >>do
    >> I use the AND function within the criteria?
    >>
    >> I can do it using one criteria at a time, but when I use AND to use two
    >> criteria, I get an error.
    >>
    >> What sytax do I use?
    >>
    >> Many thanks

    >
    >




  5. #5
    Davef2002
    Guest

    Re: Using ADD function within DCOUNT criteria

    I have managed it. In the criteria range, you have to have the two columns
    side by side and select both as one range, (without trying to use AND). If
    you try using the AND function and the columns are separated, it just does
    not work.

    Thanks for your help anyway.

    DaveF

    "Debra Dalgleish" wrote:

    > You can use two columns in the criteria area, similar to the advanced
    > filter criteria area shown here:
    >
    > http://www.contextures.com/xladvfilter01.html#Criteria
    >
    > DaveF2002 wrote:
    > > I am trying to use a DCOUNT function, and need to have two criteria. How do
    > > I use the AND function within the criteria?
    > >
    > > I can do it using one criteria at a time, but when I use AND to use two
    > > criteria, I get an error.
    > >
    > > What sytax do I use?
    > >
    > > Many thanks

    >
    >
    > --
    > Debra Dalgleish
    > Excel FAQ, Tips & Book List
    > http://www.contextures.com/tiptech.html
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1