+ Reply to Thread
Results 1 to 10 of 10

If any value in a range is between 5 and 7 do this, else this

  1. #1
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    101

    If any value in a range is between 5 and 7 do this, else this

    Hi

    Sorry about the description but, I'm unsure how to explain this more clearly and I've been trying to understand how to do this for some time now. I have a range of 10 cells with data in A1:A10. If any value in any of those cells is between 5 and 7 inclusive, then I want to take a value from A11 and use it otherwise return false.

    Any guidance would be gratefully received.

    Thanks Steven811
    Last edited by Steven811; 01-01-2013 at 06:46 AM. Reason: Solved

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: If any value in a range is between 5 and 7 do this, else this

    What if more than one cell is in that range?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: If any value in a range is between 5 and 7 do this, else this

    In my opinion if function suits u the most

  4. #4
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: If any value in a range is between 5 and 7 do this, else this

    @shg : Guru is a guru and had a better question to ask

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: If any value in a range is between 5 and 7 do this, else this

    To return the smallest among possibly several,

    =MIN(IF( (A1:A10 >= 5) * (A1:A10 <= 7), A1:A10))

    ... confirmed with Ctrl+Shift+Enter instead of just Enter.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: If any value in a range is between 5 and 7 do this, else this

    for 2003 ver
    =IF(SUMPRODUCT(--(A1:A10>=5)*(A1:A10<=7))>0,A11)
    2007+
    =IF(COUNTIFS(A1:A10,">=5",A1:A10,"<=7")>0,A11)
    Quang PT

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: If any value in a range is between 5 and 7 do this, else this

    Reckon I should read questions more closely ...

  8. #8
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    101

    Re: If any value in a range is between 5 and 7 do this, else this

    Hi Shg

    If at least one value is within that range then I perform the second calculation. It doesn't matter whether it's one or all of the values as long as it's at least one.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: If any value in a range is between 5 and 7 do this, else this

    I think bebo has you sorted with his second suggestion.

  10. #10
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: If any value in a range is between 5 and 7 do this, else this

    No need for the >0 in bebo's formula. Hence,

    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ 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