+ Reply to Thread
Results 1 to 9 of 9

Cannot figure out concise what to write if-or formula

  1. #1
    Registered User
    Join Date
    10-14-2013
    Location
    Ohio, US
    MS-Off Ver
    Excel 2010 - 2016
    Posts
    46

    Cannot figure out concise what to write if-or formula

    Greetings,

    I am trying to select only rows with values 1 through 5
    I have 50+ rows of data over columns A:R
    Each cell has a value range of 0,1,2,3,4,5, or 99

    I have used:
    =IF(OR(A2:R2=0,A2:R2=99),0,1) Doesn't work
    =COUNT(IF(OR(A2:R2=0,A2:R2=99),0,1)) Doesn't work
    =COUNTIFS(A2:R2,0,A2:R2,99) Doesn't work
    =IF(OR(a2=0,a2=99,...,r2=0,r2=99),0,1) Worked

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Cannot figure out concise what to write if-or formula

    Is it something like this?
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: Cannot figure out concise what to write if-or formula

    jam320,

    Can you attach a workbook with example data and with the desired result. Thanks.
    BrownBoy

    If happy, mark "SOVLED" & add to "REP"

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Cannot figure out concise what to write if-or formula

    Jacc forgot the possibility of 0.

    Something like this
    =IF(COUNTIF(A1:R1,">5")+COUNTIF(A1:R1,"<1"),"","SELECT")
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Cannot figure out concise what to write if-or formula

    Chemist B, you are embarrassing me! To compensate for that I had to come up with a formula of unheard of spectacularity.
    Behold the amazingness of:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    No Ctrl + Shift + Enter needed!
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Cannot figure out concise what to write if-or formula

    neat, is that a reverse division in the 0\99? Never seen one of those before!



    :P
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Cannot figure out concise what to write if-or formula

    Eeeeeeh... it was really windy here when I posted it so the | fell over like so \.

  8. #8
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Cannot figure out concise what to write if-or formula

    hehe.

    I don't quite understand the {0,99} in the formula, however

    =IF(SUM(INDEX(COUNTIF(A1:F1,{-1,99}),0)),"-","Selected")

    seems to pick up the zeros

  9. #9
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Cannot figure out concise what to write if-or formula

    It's really an array formula in disguise. Remove the INDEX and you are back to doing the three finger, salute Ctrl + Shift + Enter.
    So it's counting the instances of 0 and 99 and sums them up. As long as the sum is 0 there are no 0 or 99 present and the row is selected.
    Your Excel needs -1 to pick up the 0's? I'm not sure, is it me or is it you this time?
    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. Formula - can't figure out how to write
    By FrankParisi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-24-2013, 04:33 AM
  2. Trying to figure out best way to write formula
    By Drewszone in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-14-2013, 01:35 PM
  3. Replies: 6
    Last Post: 03-12-2012, 03:51 AM
  4. a more concise formula
    By jwongsf in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2009, 10:20 AM
  5. how do I write a formula that will figure weekly overtime?
    By jasperPcuccumber in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-17-2005, 11:10 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