+ Reply to Thread
Results 1 to 12 of 12

IF Statement with Percentages Not Working

  1. #1
    Registered User
    Join Date
    01-13-2020
    Location
    Walkersville, MD
    MS-Off Ver
    365 Office
    Posts
    5

    IF Statement with Percentages Not Working

    I need your help.

    CELL: B7 (68% Buy)

    =IF($B7<70,"SELL"," ") but it doesn't work.

    Thanks.
    Last edited by AliGW; 01-27-2020 at 02:25 AM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: IF Logical

    Does B7 have only a number or the text "68% Buy"? Please post a sample file, so we can see what's actually in cell B7.

  3. #3
    Registered User
    Join Date
    01-13-2020
    Location
    Walkersville, MD
    MS-Off Ver
    365 Office
    Posts
    5

    Re: IF Logical

    B7 is the text "68% Buy"
    Attached Files Attached Files

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: IF Logical

    Hello tps565. Welcome to the forum.

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: IF Logical

    Wouldn't it make sense to separate the number and the "buy" into different cells? Because now you have a formula next to "68% Buy" that says "Sell". Very confusing.

  6. #6
    Registered User
    Join Date
    01-13-2020
    Location
    Walkersville, MD
    MS-Off Ver
    365 Office
    Posts
    5

    Re: IF Logical

    Whoa, it works perfectly! You rock!

    Now, I just tried "RIGHT" and it doesn't work like this:

    =IF(--RIGHT(B4,3)="Buy","SELL","") but not work.

    I appreciate your help.

  7. #7
    Registered User
    Join Date
    01-13-2020
    Location
    Walkersville, MD
    MS-Off Ver
    365 Office
    Posts
    5

    Re: IF Logical

    Yes, you are right. Please look new attached file.
    Attached Files Attached Files

  8. #8
    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,917

    Re: IF Logical

    In your sample file, you expect 100% (D11) to show SELL, but your formula is looking for LESS than 70% (same for D10)?

    Also, I agree totally with Teylyn regarding breaking the value away from the text. When you have text with ANY value in the same cell, that value becomes text as well, and you cannot perform math calcs directly on it any more.
    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

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,417

    Re: IF Logical

    Try this:

    =IF(OR(--LEFT(B4,4)<70%,RIGHT(B4,4)="SELL"),"SELL","")

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As tiy are new, I will do it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    Registered User
    Join Date
    01-13-2020
    Location
    Walkersville, MD
    MS-Off Ver
    365 Office
    Posts
    5

    Re: IF Statement with Percentages Not Working

    Thank you to all for helping! I'll visit here a lot when I need your help.

    Thanks again!

    Tom

  11. #11
    Registered User
    Join Date
    11-19-2019
    Location
    Ghana, Tema
    MS-Off Ver
    office 365
    Posts
    30

    Re: IF Statement with Percentages Not Working

    you can maintain your formula =IF($B7<70,"SELL"," ") and use cell format, with the cell format you only type the figures

    eg, just type 64 and get the result in the same cell as (64% Buy) that is the your formula will read only the figure 64 in the cell to achieve the result (SELL)

    see image and attached


    Attachment 660138 Attachment 660139 Attachment 660140

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,417

    Re: IF Statement with Percentages Not Working

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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 Cell contains variuos Text, logical yes output cell text, logical No Trim
    By mwilliams400 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-12-2019, 11:58 AM
  2. Replies: 7
    Last Post: 01-07-2015, 06:29 AM
  3. How to set up that in logical way ?
    By LaserDance in forum Excel General
    Replies: 2
    Last Post: 07-09-2010, 02:53 PM
  4. Logical %
    By Excel999 in forum Excel General
    Replies: 2
    Last Post: 12-24-2008, 01:41 AM
  5. Logical if
    By Excel999 in forum Excel General
    Replies: 9
    Last Post: 12-23-2008, 05:55 AM
  6. Logical Value
    By At A Loss in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-13-2006, 12:55 PM
  7. Most logical value
    By Alex in forum Excel General
    Replies: 2
    Last Post: 02-13-2005, 06: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