+ Reply to Thread
Results 1 to 6 of 6

Logical Operators within formulas

  1. #1
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Logical Operators within formulas

    Hi all,

    Could someone help with this please. I have as array with a formula that contains a greater than function as shown below. I'd like this formula to change to a less than or greater than operator dependant on the operator in another cell but i'm not sure how to reference another cell with a logical operator.


    =IFERROR(INDEX('Sheet1'!$B$1:$B$100,SMALL(IF(INDIRECT('Sheet1'!$B$1:$B$2)>$C$3,ROW(INDIRECT('Sheet1'!$B$1:$B$2))),ROW(1:1))),"")


    perhaps something like?


    =IFERROR(INDEX('Sheet1'!$B$1:$B$100,SMALL(IF(INDIRECT('Sheet1'!$B$1:$B$2)&D1&$C$3,ROW(INDIRECT('Sheet1'!$B$1:$B$2))),ROW(1:1))),"")

    where D1 contains either a < or a >.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Logical Operators within formulas

    Please try
    =IFERROR(INDEX('Sheet1'!$B$1:$B$100,SMALL(IF(INDIRECT('Sheet1'!$B$1:$B$2)<>$C$3,ROW(INDIRECT('Sheet1'!$B$1:$B$2))),ROW(1:1))),"")

  3. #3
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Logical Operators within formulas

    Sorry this isn't what i'm looking for. I need a selection between a greater than or less than operator within the formula so it will need to point to another cell containing either of those, but its how to embody that within the formula. C3 just contains the value to compare against.

    Thanks.

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Logical Operators within formulas

    Maybe try

    =IFERROR(INDEX(Sheet1!$B$1:$B$100,SMALL(IF(IF(D1="<",INDIRECT(Sheet1!$B$1:$B$2)<$C$3,INDIRECT(Sheet1!$B$1:$B$2)>$C$3),ROW(INDIRECT(Sheet1!$B$1:$B$2))),ROW(1:1))),"")

  5. #5
    Registered User
    Join Date
    07-27-2017
    Location
    UK
    MS-Off Ver
    2012
    Posts
    43

    Re: Logical Operators within formulas

    Thanks, I wanted to avoid making the formula larger by embedding another IF hence if you could simply point to another cell using &D1&>$C$3... I'm not sure why that doesn't work though.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Logical Operators within formulas

    > < = are operate that cannot use with & as it becomes text but Countif condition can use with text.

    perhaps
    =IFERROR(INDEX(Sheet1!$B$1:$B$100,SMALL(IF(COUNTIF($C$3,D1&INDIRECT(Sheet1!$B$1:$B$2)),ROW(INDIRECT(Sheet1!$B$1:$B$2))),ROW(1:1))),"")

+ 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. [SOLVED] IF statment logical operators
    By kylele77 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2015, 05:06 PM
  2. Use Logical Operators as Parameters in a VBA function
    By grazian2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2014, 04:50 PM
  3. if with logical operators
    By dagobax in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2014, 07:19 AM
  4. Combining Multiple if statements using logical operators
    By arahant16 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2014, 03:49 AM
  5. [SOLVED] Can logical operators be used within Conditional Formatting?
    By Rumpa Biswas in forum Excel General
    Replies: 8
    Last Post: 12-03-2012, 03:23 AM
  6. Multiple Logical Operators
    By bluesstruggler in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-22-2011, 09:27 PM
  7. Syntax for Logical Operators to Limit Input?
    By DCSwearingen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2006, 11:14 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