+ Reply to Thread
Results 1 to 3 of 3

Include OR statement in COUNTIF?

  1. #1
    Registered User
    Join Date
    08-06-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Include OR statement in COUNTIF?

    Hello,

    I have a set of data as attached. Data_Calculation.xlsx

    Column I denotes velocity data for each time-point (in seconds), as per Column D. Column H indicates a velocity threshold, that being, if the raw velocity data (located in B) is between particular velocity bands (cells B13 and C13, respectively), a 1 is placed in cells of Column G. If there are two consecutive 1's in column G, column H will print a 1 in the cell. If this condition is not met, a 0 will be placed. Further, if a 1 exists in a cell in Column H, the velocity distance from F3 will be printed. Cell I12 indicates the total distance completed in this velocity band.

    However, this total distance is incorrect, as the first recorded distance in the threshold is not included. For example, G4, is still distance traveled over this threshold and contributes to a minimum of two consecutive cells.

    Currently, I have in Column I, =IF(COUNTIF(H3,"1"),F3,"")
    Is there a way of incorporating an OR statement so that if the above is false, it next looks in H4 and if there is a 1 in this cell, the data in F3 is printed in I3?

    Any help would be greatly appreciated.

    Thank you!

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Include OR statement in COUNTIF?

    hi there. do you mean this?
    =IF(OR(COUNTIF(H3,1),H4),F3,"")

    you could remove the double quotes for the 1 since it's a number. and to help us understand better, you can always type the answers you hope to see in Column I. the above chunk of info you provided are mostly unnecessary. this portion will do:
    Currently, I have in Column I, =IF(COUNTIF(H3,"1"),F3,"")
    Is there a way of incorporating an OR statement so that if the above is false, it next looks in H4 and if there is a 1 in this cell, the data in F3 is printed in I3?

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    08-06-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Include OR statement in COUNTIF?

    Thank you so very much, benishiryo.

    That formula worked perfectly.

    Apologies for all the unnecessary information, the last thread I created was too brief initially, so thought it best to explain the data.

    Thank 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. Countif Function that will automatically include last row
    By g26 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-16-2013, 07:57 PM
  2. [SOLVED] Countif, do not include greater than a set value
    By bungslea in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 04-01-2013, 04:00 AM
  3. Include vlookup within if statement
    By jpruffle in forum Excel General
    Replies: 2
    Last Post: 07-14-2009, 05:52 PM
  4. how to include in countif?
    By slipit1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2008, 04:21 PM
  5. Include several choices in an IF statement.
    By kevin in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-12-2005, 08:06 AM

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