+ Reply to Thread
Results 1 to 7 of 7

Formula with <= and >=

  1. #1
    Registered User
    Join Date
    05-02-2012
    Location
    SS
    MS-Off Ver
    Excel 2007
    Posts
    29

    Wink Formula with <= and >=

    Hi,

    Im hoping you can help me figure this out.

    I have a formula that calculates if a value is greater than or less than other value. That part is simple . But what I want to do is to have a cell with a list value with <= => that modifies the formula one its changed.

    I have uploaded an image to better explain my self. As you can see, on column C I have <= . Column K has this formula =IF(G2<=$J$2,1,0). So what is breaking my head is how to make the formula on column K change according column C.

    Thanks
    Attached Images Attached Images

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Formula with <= and >=

    Please do not upload a picture of your file...rather, upload a sample of your workbook, showing what data you are working with, a few samples of your expected outcome is (manually entered is ok) and how you arrived at that. (exclude sensitive info). Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you Also, not all members can upload picture files (Company firewalls and stuff)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,464

    Re: Formula with <= and >=

    Not sure if this is what you have in mind but have a look at the attached sample workbook.

    Regards, TMS
    Attached Files Attached Files
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    05-02-2012
    Location
    SS
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Formula with <= and >=

    Sorry for uploading an image. I have attached an excel file.

    thanks
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Formula with <= and >=

    Hi,

    Try this in K2:

    =SUMPRODUCT(COUNTIF(C2,"*"&{"<","=",">"}&"*")*(SIGN($J$2-G2)+{0,1,2}=1))

    Works for the three comparators: <, > and =.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

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

    Re: Formula with <= and >=

    With your active cell being K2, go to Defined Names> New
    Set up
    Eval = EVALUATE(G2&$C$2&$J$2)

    Then in K2
    =IF(Eval,1,0) copied to the right. See attached sheet.

    Evaluate is a MACRO 4 command and requires you save your file as an xls or xlsm.
    Attached Files Attached Files
    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

  7. #7
    Registered User
    Join Date
    05-02-2012
    Location
    SS
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Formula with <= and >=

    Thank you so much for the help. It really solve my formula problem :D

+ 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. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 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