+ Reply to Thread
Results 1 to 9 of 9

Adding an OR statement into formula

  1. #1
    Registered User
    Join Date
    03-04-2014
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    Question Adding an OR statement into formula

    Hi

    I have the following formula but I need to amend it with an OR. I would like the formula average totals if P = "T" and V = "T" but they don't both have to be "T". I have tried a couple of variations now but don't seem to be able to get the correct average??

    =AVERAGE(IF(ISNUMBER('Before Oct13'!$AE$2:$AE$78),IF('Before Oct13'!$P$2:$P$78="T",IF('Before Oct13'!$V$2:$V$78="T",'Before Oct13'!$AE$2:$AE$78))))

    Please help!
    Many thanks
    Mack_76

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Adding an OR statement into formula

    Attach a sample file, and enter expected results manually
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    03-04-2014
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Adding an OR statement into formula

    1 Excel Query.xlsx

    File attached

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Adding an OR statement into formula

    So if EITHER P= T, OR V = T, take an average.... is that what you want? If so, how do you want the #N/A errors in (e.g.) rows 16, 43, etc, handled?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Registered User
    Join Date
    03-04-2014
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Adding an OR statement into formula

    Hi

    Yes that is correct. I want the formula to ignore errors which it does in my orignal formula?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Adding an OR statement into formula

    Basically:

    =AVERAGE(IF(ISNUMBER('Before Oct13'!$AE$2:$AE$78),IF(SIGN(('Before Oct13'!$P$2:$P$78="T")+('Before Oct13'!$V$2:$V$78="T")),'Before Oct13'!$AE$2:$AE$78)))
    Remember what the dormouse said
    Feed your head

  7. #7
    Registered User
    Join Date
    03-04-2014
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Adding an OR statement into formula

    Thank you, thank you, thank you...

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Adding an OR statement into formula

    One Q Romperstomper. What does SIGN do in this formula? Excluding it doesn't seem to make any difference...

    I was working my way towards this when you posted....
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 01-21-2015 at 11:42 AM.

  9. #9
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Adding an OR statement into formula

    You're correct - I wasn't really paying attention to the formula as written. I tend to multiply the conditions rather than using IF clauses, in which case you do need it to avoid double counting.

+ 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. [SOLVED] Adding an extra IF statement into a LARGE formula
    By Fursmanm in forum Excel General
    Replies: 4
    Last Post: 08-07-2012, 10:21 AM
  2. Adding an If statement to an Index Match Formula
    By brandiemz101 in forum Excel General
    Replies: 3
    Last Post: 11-16-2011, 03:25 PM
  3. Problem with adding formula with a last row statement
    By WasWodge in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2011, 07:50 PM
  4. Adding Another IF statement to a Formula
    By robertguy in forum Excel General
    Replies: 2
    Last Post: 08-16-2010, 11:50 AM
  5. Adding an OR statement into formula
    By dvent in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-11-2008, 08:39 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