+ Reply to Thread
Results 1 to 14 of 14

Attempted to set up formula for IFS statement using OR but Excel is saying invalid

  1. #1
    Registered User
    Join Date
    05-10-2016
    Location
    South West England
    MS-Off Ver
    Online/ 365
    Posts
    49

    Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    Hi,

    Just looking to get a check on this formula, I have underlined where I think I've gone wrong but if someone could tell me what has gone wrong and how to correct, I'd appreciate it, thanks.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    All The Best,
    Dan
    Last edited by danjackson5; 08-02-2021 at 11:58 AM. Reason: Expanded Topic Title

  2. #2
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,778

    Re: Formula Check

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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.

  3. #3
    Registered User
    Join Date
    05-10-2016
    Location
    South West England
    MS-Off Ver
    Online/ 365
    Posts
    49

    Re: Formula Check

    I have tried to expand the title but I'm not sure how helpful it is? You say Tell us what you are trying to do. I thought "Check a formula" was accurate?

  4. #4
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,778

    Re: Can someone please validate the formula as excel says it is incorrect

    I have responded to your PM. I am not 100% happy with your latest title, but will accept it for now until you have read my PM.

    It's very hard to debug formulae sometimes without seeing them in context, but I'd try removing bits of parenthesis first:

    =IFERROR(OR(IFS(C4=1,SETTINGS!A20,E4=1, SETTINGS!A21, G4=1, SETTINGS!A22, I4=1, SETTINGS!A23),IFS(D4=1,SETTINGS!A20,F4=1, SETTINGS!A21, H4=1, SETTINGS!A22, I4=1, SETTINGS!A23))))

    What are you expecting this formula to do? If you use OR, you need statements (formulae) that will return TRUE or FALSE - this doesn't look like it will do that, but without seeing it in situ, it's really hard to tell.

    Attach a workbook.

  5. #5
    Registered User
    Join Date
    05-10-2016
    Location
    South West England
    MS-Off Ver
    Online/ 365
    Posts
    49

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    I can understand the requirement for the title but perhaps specify a template for when it isn't so obvious? I have read the rules but it wasn't easy to work out what is that was required. I hope the new title is better?

    Sample workbook attached, thanks
    Attached Files Attached Files

  6. #6
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,778

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    There's no need to specify a template. All you have to do is ask yourself: what am I trying to do and what's going wrong? That's your thread title. New title is MUCH better - thanks.

    I will have a look, but you still haven't said what you are expecting the formula to do ...

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,778

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    Sorry - I cannot troubleshoot this, Dan.

    1. The formula refers to a tab called SETTINGS - there is no such tab.
    2. You still haven't explained in any clarity what you want the formula to do.

    At the moment it's a dog's dinner (sorry), and I cannot see for the life of me what you are attempting to achieve.

    Please explain in WORDS what you want the formula to do.

  8. #8
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,778

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    Does this do what you want?

    =LOOKUP(INDEX($C$3:$I$3,MATCH(1,$C4:$I4,0)),{"APP","ILL 1","ILL 2","PH 1","PH 2","UH 1","UH 2"},{"Appointment","Ill","Ill","Paid Holiday","Paid Holiday","Unpaid Holiday","Unpaid Holiday"})

  9. #9
    Registered User
    Join Date
    05-10-2016
    Location
    South West England
    MS-Off Ver
    Online/ 365
    Posts
    49

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    That is a way around it and i think i can get the jist of that formula. I use a settings page which lists all the names and the 4 options

    To Clarify

    IFERROR - Standard blank any errors

    IF C4 OR D4=1, Show SETTINGS!A20

    IF E4 OR F4=1, Show SETTINGS!A21

    IF G4 OR H4=1, Show SETTINGS!A22

    IF I4=1, Show SETTINGS!A23 (There's Only 1 Column for this one)

    The reason i prefer the IFS and OR statements is because i better understand them and will be able to make changes further down the road. Same with the settings page - future planning. The issue with the formula you have provided, although efficient, it doesn't allow for me to reference the settings page to apply to multiple people.

  10. #10
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,778

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    Dan - you are not going to like this.

    Using multiple nested IF or IFS is NOT the way forward. And no, it isn't actually easier to change things down the line.

    I will mock up an example of something that will be much easier for you. Back in five minutes.

  11. #11
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,778

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    Attached is a much easier solution.

    You need a lookup table (can be on a separate sheet):

    Excel 2016 (Windows) 32 bit
    L
    M
    3
    PH
    Paid Holiday
    4
    UH
    Unpaid Holiday
    5
    ILL
    Ill
    6
    APP
    Appointment
    Sheet: JAN

    Then you use this formula:

    =IFERROR(LOOKUP(1000,SEARCH($L$3:$L$6,INDEX($C$3:$I$3,MATCH(1,$C4:$I4,0))),$M$3:$M$6),"")

    INDEX($C$3:$I$3,MATCH(1,$C4:$I4,0)) - this returns the header above the 1 in the row

    IFERROR(LOOKUP(1000,SEARCH($L$3:$L$6 - this looks at the lookup list in the lookup table and finds a match for the header

    ),$M$3:$M$6),"") - this returns the value next to the lookup text in the lookup table.

    Use Evaluate Formula on the Formulas ribbon to step through and see what it's doing.

    Get into the habit of using lookup tables instead of nested IF statements, otherwise you will forever be getting yourself into a mess, like you did today. Be prepared to expand your horizons which will, in the long run,make things MUCH easier for you.
    Attached Files Attached Files

  12. #12
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: Attempted to set up formula for IFS statement using OR but Excel is saying invalid

    Quote Originally Posted by danjackson5 View Post
    T

    IFERROR - Standard blank any errors

    IF C4 OR D4=1, Show SETTINGS!A20

    IF E4 OR F4=1, Show SETTINGS!A21

    IF G4 OR H4=1, Show SETTINGS!A22

    IF I4=1, Show SETTINGS!A23 (There's Only 1 Column for this one)

    .
    If I understood correctly, your request translates into the formula like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  13. #13
    Registered User
    Join Date
    05-10-2016
    Location
    South West England
    MS-Off Ver
    Online/ 365
    Posts
    49
    Quote Originally Posted by AliGW View Post
    Attached is a much easier solution.
    Thank you. I see I have some studying for the weekend ahead 😉

    I’ll use your example and adapt to a few different scenarios before attempting the real thing. I understand the premise but need to delve a little more to be fully aware of the code so I can integrate into an existing system. Fun days!!!

    Thanks again. I’ll Mark as complete but no rep as I’m showing favouritism 😁

    Dan

  14. #14
    Registered User
    Join Date
    05-10-2016
    Location
    South West England
    MS-Off Ver
    Online/ 365
    Posts
    49
    Quote Originally Posted by tanasedn View Post
    If I understood correctly, your request translates into the formula like this…
    I see. So I needed to use multiple OR statements for each argument… that makes sense - going to add this to my handy tool box, thank you for your help

    Dan

+ 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: 5
    Last Post: 03-14-2020, 03:58 AM
  2. Need formula to check cell and if certain value process second formula
    By oconee1985 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-10-2018, 02:25 AM
  3. [SOLVED] i want formula check cell if cell is blank go to next cell and check value and give grades
    By pksrikanth85 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-19-2017, 12:42 PM
  4. How to check if excel file is Checked Out in SharePoing Check Out, run code, Check In
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2016, 04:36 PM
  5. [SOLVED] Use a formula to check if another formula contains specific text/string
    By musketeer in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 04-24-2013, 05:09 PM
  6. Automatically check one or more check boxes when a parent check box is manually checked
    By Steverizer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-28-2013, 01:56 PM
  7. Replies: 6
    Last Post: 03-13-2013, 12:40 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