+ Reply to Thread
Results 1 to 5 of 5

if or statement for 2 reference cells resulting in sum of a range

  1. #1
    Registered User
    Join Date
    02-07-2024
    Location
    Vacouver, Canada
    MS-Off Ver
    Office 365
    Posts
    46

    if or statement for 2 reference cells resulting in sum of a range

    I need help fixing the following formula, I would like to return 0 if ay5 or ay20 is complete otherwise return the sum of aw20:ax20

    =IF(OR(AY5="*complete*",AY20="*complete*"),0,SUM(AW20:AX20))

    the following formula returns the the sum of aw20:ax20 regardless of whether the formula is true or false.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,812

    Re: if or statement for 2 reference cells resulting in sum of a range

    You need to do it like this:

    =IF(OR(COUNTIF(AY5,"*complete*"),COUNTIF(AY20,"*complete*")),0,SUM(AW20:AX20))

    as the IF function does not recognise wildcard characters. You could also use ISNUMBER in conjunction with SEARCH (no wildcards needed), or with MATCH (with wildcards).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-07-2024
    Location
    Vacouver, Canada
    MS-Off Ver
    Office 365
    Posts
    46

    Re: if or statement for 2 reference cells resulting in sum of a range

    Thank you so much, that's exactly what I'm looking for =).

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,812

    Re: if or statement for 2 reference cells resulting in sum of a range

    Glad to help, Chris - thanks for the rep.

    Pete

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,426

    Re: if or statement for 2 reference cells resulting in sum of a range

    Or you could try this (untested):

    =IF((AY5="*complete*")*(AY20="*complete*")=0,0,SUM(AW20:AX20))

    EDIT: no, doesn't work. I misread the requirement - sorry!
    Last edited by AliGW; 04-28-2024 at 02:01 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] IF/THEN Statement is resulting False, but Should be True
    By kelli84 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-19-2021, 12:03 PM
  2. [SOLVED] Reference the Resulting Value
    By liquidtrails in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-05-2014, 10:04 AM
  3. [SOLVED] Multiple Calculation IF Statement resulting in words HELP!
    By CNNNN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-04-2012, 10:53 AM
  4. Find the Cell Reference Resulting from MAX function
    By Excel User in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-20-2005, 04:10 PM
  5. [SOLVED] How to replace a function with its resulting reference in a formula?
    By Dmitry Kopnichev in forum Excel General
    Replies: 7
    Last Post: 10-13-2005, 05:05 PM
  6. How to replace a function with its resulting reference in a formula?
    By Dmitry Kopnichev in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-13-2005, 05:05 PM
  7. [SOLVED] How to replace a function with its resulting reference in a formula?
    By Dmitry Kopnichev in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-13-2005, 05:05 PM

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