+ Reply to Thread
Results 1 to 8 of 8

How to simplify an IF(OR function?

  1. #1
    Registered User
    Join Date
    10-27-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4

    How to simplify an IF(OR function?

    I have the following function and I'm wondering if there is a way to simplify it all so it's not so tedious to enter into multiple cells. Essentially, is there a way to search multiple cells for a value instead of doing a huge or function. The one I am currently using that works fine but is long is this:

    =I8-H8-G24*(IF(OR($P$3="Comprehension",$P$4="Comprehension",$P$5="Comprehension",$P$6="Comprehension",$P$7="Comprehension",$P$8="Comprehension",$P$9="Comprehension",$P$10="Comprehension",$P$11="Comprehension",$P$12="Comprehension",$P$13="Comprehension",$P$14="Comprehension",$P$15="Comprehension",$P$16="Comprehension",$P$17="Comprehension"),4,2))

    Is there a way to simplify that? Thanks for the help.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: How to simplify an IF(OR function?

    Maybe this?
    Please Login or Register  to view this content.
    Drag/Fill Down

    A sample workbook showing your expected results would not go amiss.

    Hope this helps.
    Last edited by Marcol; 10-27-2010 at 07:33 PM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to simplify an IF(OR function?

    Hi,

    One way

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,732

    Re: How to simplify an IF(OR function?

    ...or try...

    =I8-H8-G24*IF(COUNTIF($P$3:$P$17,"Comprehension"),4,2)
    Audere est facere

  5. #5
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: How to simplify an IF(OR function?

    =I8-H8-G24*(IF(OR($P$3:$P$17="compression"),4,2))

    needs to be entered with ctrl shift + enter
    Last edited by Paul; 10-27-2010 at 11:12 PM. Reason: Replaced "ctrl shift + delete" with "ctrl shift + enter"

  6. #6
    Registered User
    Join Date
    10-27-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to simplify an IF(OR function?

    Quote Originally Posted by daddylonglegs View Post
    ...or try...

    =I8-H8-G24*IF(COUNTIF($P$3:$P$17,"Comprehension"),4,2)
    This seemed to work well. what does the CTRL+SHIFT+ENTER do though? Evaluate it as an array?

  7. #7
    Registered User
    Join Date
    10-27-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: How to simplify an IF(OR function?

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    One way

    Please Login or Register  to view this content.
    HTH
    This ended up working perfectly for me and I was able to modify it for many other uses in my workbook. Thanks for this, the other array function given wouldn't work for me because I was using lots of merged cells

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,732

    Re: How to simplify an IF(OR function?

    Quote Originally Posted by Starfleeter View Post
    This seemed to work well. what does the CTRL+SHIFT+ENTER do though? Evaluate it as an array?
    Note: my suggestion with COUNTIF doesn't require CSE.....

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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