+ Reply to Thread
Results 1 to 5 of 5

IF function for a range of numbers within another range

  1. #1
    Registered User
    Join Date
    01-27-2008
    Posts
    3

    IF function for a range of numbers within another range

    I work in communications, and want to display a spreadsheet that shows whether a transmitter can be receiveed by particular receivers as follows:

    Data Rows:

    Transmitter....LOW FREQ...HI FREQ......Receiver......LOW FREQ....HIGH FREQ
    XTR 1............123 Mhz......300 Mhz......RCVR1........ 50 Mhz.......1000 Mhz

    Since the receiver's capabilities are 50 - 1000 Mhz, the transmitter falls into it's reception range. So I would use a function in a cell next to the Receiver name to result in a simple 1 or 0. 1 being capable or receiving that transmitter, 0 not capable. Then use Conditional Formatting to turn that cell Green or Red respectively based on the 1 or 0.

    I have tried nested IF functions to no avail. If any part of the transmitter number range falls within the receiver's number range, I want to simply color a cell green or red.

    Sorry for the verbose post, hope I got my point across, and appreciate any assistance.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If Transmitter,TransLow,TransHigh,rcvName,RcvLow,RcvHigh are in columns A-F

    Put this in G2
    =--OR(AND(B2<E2,E2<C2),AND(B2<F2,F2<C2))

    The conditional formatting custom Equation would be
    =OR(AND(B2<E2,E2<C2),AND(B2<F2,F2<C2))
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    01-27-2008
    Posts
    3
    Thank for the help, although it needed a little tweaking to function correctly for a transmitter less than the RCV LOW and greater than the RCV HIGH.

    I take it the -- in front of the or function converts the True or False to a 1 or 0?

    Here's the final formula I cam up with that worked:

    Please Login or Register  to view this content.
    And the conditional formatting on that cell is just based off the resulting 1 or 0.

    Thank you!!

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    I see how the transmitter and receiver function differently than I thought.
    If its always the case that B2<=C2 , then the first AND can be removed.

    =--OR(C2<E2,AND(B2>F2,F2<C2))

    You are right, the double negation causes Excel to evaluate TRUE or FALSE as
    -1 * -1 * (true=1/false=0)

  5. #5
    Registered User
    Join Date
    01-27-2008
    Posts
    3
    That's perfect, THANK YOU Mike!!

+ 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