+ Reply to Thread
Results 1 to 6 of 6

Countif

  1. #1
    Registered User
    Join Date
    02-10-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    10

    Exclamation Countif

    Hi wondered if anyone could advise what would be the best formula to use. I've been trying countif with no success.

    I have a spreadsheet with a number of different columns
    KILL DATE TIME LEFT TIME ARRIVED PH Overnight (Yes/No)
    30/08/2013 15:30 17:00 5.48 No
    30/08/2013 NR NR 5.41 Yes
    30/08/2013 06:30 11:40 5.47 No
    04/09/2013 05:35 07:20 5.29 Yes
    05/09/2013 10.05 14:40 5.71 No

    What I would really like is to be able to Count how many times a pH is less than 5.30 in August; pH is between 5.30 and 5.69 in August; pH is over 5.7 in August, same for September etc.

    I have used the following for a simpler query:
    =COUNTIFS('2013'!$a$1:$a$5,">=01/08/2013",'2013'!$a$1:$a$5,"<=31/08/2013",'2013'!$e$1:$e$5,"Yes"), which works fine but if i try
    =COUNTIFS('2013'!$a$1:$a$5,">=01/08/2013",'2013'!$a$1:$a$5,"<=31/08/2013",'2013'!$d$1:$d$5,">=5.30",'2013'!$d$1:$d$5,"<=5.70") I have no joy.

    i should mention that the '2013' referred to is the workbook that contains the data (trying to do the queries on a Stats workbook).

    Anyone any ideas?

    Many thanks

    Chris
    Last edited by Christine Jackson; 01-08-2014 at 10:12 AM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Which Formula to use

    Use

    =COUNTIFS('2013'!$a$1:$a$5,">=01/08/2013",'2013'!$a$1:$a$5,"<=31/08/2013",'2013'!$d$1:$d$5,">="&5.30,'2013'!$d$1:$d$5,"<="&5.70)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Which Formula to use

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT POST then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    02-10-2010
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Which Formula to use

    Many thanks for taking the trouble to respond. Now working correctly. Many thanks again

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Countif

    Better to use cells to hold the criteria:

    A2 = 1/8/2013
    B2 = 31/8/2013
    C2 = 5.3
    D2 = 5.7

    =COUNTIFS('2013'!$A$1:$A$5,">="&A2,'2013'!$A$1:$A$5,"<="&B2,'2013'!$D$1:$D$5,">="&C2,'2013'!$D$1:$D$5,"<="&D2)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Countif

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

Tags for this Thread

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