+ Reply to Thread
Results 1 to 14 of 14

How to skip if no true condition found in IFS statement

  1. #1
    Registered User
    Join Date
    05-03-2021
    Location
    US
    MS-Off Ver
    2016
    Posts
    18

    Question How to skip if no true condition found in IFS statement

    If all of the conditions in the IFS statement are false I would like it to return no value. This is because the values returned are within an AVERAGE function and if no value is returned I would like it to simply not be factored in the assessment.

    As it is, if all the conditions are false it returns N/A ruining the entire function.

  2. #2
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: How to skip if no true condition found in IFS statement

    Can encapsulate your entire formula with IFERROR. Second parameter will allow you to have whatever you want instead of the hashtag error. If you want it to be blank, a formula would look like below. You can change the "" to whatever you want it to say.

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: How to skip if no true condition found in IFS statement

    Look at the IFERROR function

    https://support.microsoft.com/en-us/...6-63f3e417f611
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    05-03-2021
    Location
    US
    MS-Off Ver
    2016
    Posts
    18

    Re: How to skip if no true condition found in IFS statement

    The point is that I want the average to be calculated, I just want it to not be part of the average. Since it not being included reduces the total number of values this has little impact.

  5. #5
    Registered User
    Join Date
    05-03-2021
    Location
    US
    MS-Off Ver
    2016
    Posts
    18

    Re: How to skip if no true condition found in IFS statement

    I meant to say skip the value, not the entire average, so that the average itself can be computed.

  6. #6
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: How to skip if no true condition found in IFS statement

    I am not following you. What is the current formula you are using?

  7. #7
    Registered User
    Join Date
    05-03-2021
    Location
    US
    MS-Off Ver
    2016
    Posts
    18

    Re: How to skip if no true condition found in IFS statement

    Neither of these work:

    =AVERAGE(IFS(Y3="Disapprove",1.1,Y3="Approve",0.9),IFS(Z3="Disapprove",1.1,Z3="Approve",0.9),IFS(AA3="Disapprove",1.05,AA3="Approve",0.95)

    =AVERAGE(IFS(Y3="Disapprove",1.1,Y3="Approve",0.9,Y3="Skipped",""),IFS(Z3="Disapprove",1.1,Z3="Approve",0.9,Z3="Skipped",""),IFS(AA3="Disapprove",1.05,AA3="Approve",0.95,AA3="Skipped","")

    The idea is that if the answer is Skipped that factor is simply not included in the average. I do not want it to be included as "1" because this would make the average seem more neutral than it should be, I would like it to simply not be included when computing the average.
    Last edited by reagr; 11-29-2022 at 07:40 PM.

  8. #8
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: How to skip if no true condition found in IFS statement

    I think this will do it:

    Please Login or Register  to view this content.
    There is probably something more elegant out there, but that should get the job done.

  9. #9
    Registered User
    Join Date
    05-03-2021
    Location
    US
    MS-Off Ver
    2016
    Posts
    18

    Re: How to skip if no true condition found in IFS statement

    No--that wouldn't work because 0 would be included in the average. I feel like you don't know how averages work.

    The average of 3 and 2 is 2.5. The average of 3, 2 and 0 is 1.67. The former number is what I want (by virtue of the third value not being included in the average).
    Last edited by reagr; 11-29-2022 at 08:05 PM.

  10. #10
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: How to skip if no true condition found in IFS statement

    I know pretty well how averages work. Please note that nowhere in that formula is AVERAGE used The denominator is determined by the second SUM formula, so it will return a number from 1 to 3. Try it out and see

  11. #11
    Registered User
    Join Date
    05-03-2021
    Location
    US
    MS-Off Ver
    2016
    Posts
    18

    Re: How to skip if no true condition found in IFS statement

    Thank you very much for pointing out that oversight. The issue is that it would not automatically calculate the value to divide it by, unless you can count the number of 0s calculated within the function.

  12. #12
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: How to skip if no true condition found in IFS statement

    Quote Originally Posted by reagr View Post
    Thank you very much for pointing out that oversight. The issue is that it would not automatically calculate the value to divide it by, unless you can count the number of 0s calculated within the function.
    You should not need anything else. I will explain how that works. Average = sum of values / number of values i.e. (2+3+5+7) / 4. That formula uses two SUM formulas. The first one will sum up the values returned by all your IFS formulas. They include your decimals. The second SUM formula, after the / symbol, will result in a 1 or a 0 based on your values of Approve, Disapprove, or Skipped. The maximum value there is 3. It could possibly error out if you choose skip for all values. That second sum, in essence, will count the number of values.

    Hope that makes sense at all.

  13. #13
    Registered User
    Join Date
    05-03-2021
    Location
    US
    MS-Off Ver
    2016
    Posts
    18

    Re: How to skip if no true condition found in IFS statement

    I obviously didn't read your function nearly carefully enough--I skimmed over it because of its length. Thank you for the explanation.

  14. #14
    Valued Forum Contributor
    Join Date
    11-29-2022
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    430

    Re: How to skip if no true condition found in IFS statement

    I have attached a workbook that will do what you want and is much cleaner to look at. Hope it helps.
    Attached Files Attached Files

+ 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. Replies: 6
    Last Post: 08-19-2019, 08:55 AM
  2. [SOLVED] Formula to skip cell if condition is true/false
    By tjb0012 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-13-2018, 02:45 PM
  3. [SOLVED] Skip where no true
    By Excelski in forum Excel General
    Replies: 15
    Last Post: 01-02-2018, 11:29 AM
  4. Help popup window if condition is TRUE in change event if conditon is true
    By fanku in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-09-2014, 12:46 PM
  5. If statement is true, skip line go to next value
    By jperl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-24-2014, 12:24 PM
  6. Searching for a value but skip the first found value.
    By george1982 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-14-2009, 09:35 AM
  7. skip to next cell if no value is found
    By AirCav in forum Excel General
    Replies: 0
    Last Post: 02-09-2006, 01:50 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