+ Reply to Thread
Results 1 to 13 of 13

If function to find % of a value

  1. #1
    Registered User
    Join Date
    10-15-2014
    Location
    Qatar
    MS-Off Ver
    2013
    Posts
    7

    Lightbulb If function to find % of a value

    6000 X
    5000 Y
    2000 Y
    3000 X
    2500 Y
    1280 X
    3000 X

    If column A with values and the column B with Letters,
    please advise me how to find this..
    if B1 is X, C1 will be 3% of A1, and if B1 is Y, C1 will be 2% of A1

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: If function to find % of a value

    =if( B1="X", A1*0.03, IF( B1="Y", a1*0.02, "B does not = Y or X"))

    If you can only have a Y or an X in column B
    this can be simplified to

    =if( B1="X", A1*0.03, a1*0.02)
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: If function to find % of a value

    Hi,

    a possible approach:

    =A1*(B1="X")*3%+A1*(B1="Y")*2%

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  4. #4
    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,425

    Re: If function to find % of a value

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



    Regards, TMS
    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


  5. #5
    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,425

    Re: If function to find % of a value

    Slight variation on Canapone's formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    His formula is good because, if column B is neither "X" or "Y" you will automatically get zero (0) returned.

    Regards, TMS

  6. #6
    Registered User
    Join Date
    10-15-2014
    Location
    Qatar
    MS-Off Ver
    2013
    Posts
    7

    Re: If function to find % of a value

    Thank you very much.. it works...

  7. #7
    Registered User
    Join Date
    10-15-2014
    Location
    Qatar
    MS-Off Ver
    2013
    Posts
    7

    Re: If function to find % of a value

    This is also correct but, I dont get it.. thanks anyway..

  8. #8
    Registered User
    Join Date
    10-15-2014
    Location
    Qatar
    MS-Off Ver
    2013
    Posts
    7

    Re: If function to find % of a value

    Quote Originally Posted by etaf View Post
    =if( B1="X", A1*0.03, IF( B1="Y", a1*0.02, "B does not = Y or X"))

    If you can only have a Y or an X in column B
    this can be simplified to

    =if( B1="X", A1*0.03, a1*0.02)
    Works thanks..

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: If function to find % of a value

    your welcome, thanks for the rep

  10. #10
    Registered User
    Join Date
    10-15-2014
    Location
    Qatar
    MS-Off Ver
    2013
    Posts
    7

    Re: If function to find % of a value

    Quote Originally Posted by canapone View Post
    Hi,

    a possible approach:

    =A1*(B1="X")*3%+A1*(B1="Y")*2%

    Regards
    this too works.. but i dont get it clearly.. never mind about my ability.. thanks again..

  11. #11
    Registered User
    Join Date
    10-15-2014
    Location
    Qatar
    MS-Off Ver
    2013
    Posts
    7

    Re: If function to find % of a value

    Quote Originally Posted by TMS View Post
    Slight variation on Canapone's formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    His formula is good because, if column B is neither "X" or "Y" you will automatically get zero (0) returned.

    Regards, TMS
    That's awesome.. thanks bro..

  12. #12
    Registered User
    Join Date
    10-15-2014
    Location
    Qatar
    MS-Off Ver
    2013
    Posts
    7

    Re: If function to find % of a value

    Quote Originally Posted by TMS View Post
    Slight variation on Canapone's formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    His formula is good because, if column B is neither "X" or "Y" you will automatically get zero (0) returned.

    Regards, TMS
    That's awesome.. thanks bro..

  13. #13
    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,425

    Re: If function to find % of a value

    You're welcome.

    B1="X" will be TRUE if B1 contains the value "X". This will be evaluated as one (1) so, multiplied by 3% gives you 3% of A1. If B1 does not contain "X", it will be FALSE and evaluated as zero (0), and when multiplied by 3% gives you 0% of A1. Similarly, you compare to "Y". If B1 is not "X" or "Y", both equations will evaluate to 0.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. add in the parameters to the Find function to only find an exact match.
    By jakeembx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2014, 08:57 AM
  2. [SOLVED] Problem with Find function. Need to find Exact match
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2012, 07:07 AM
  3. find function doesnt find imported info
    By dscott2479 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-12-2011, 07:11 PM
  4. Replies: 2
    Last Post: 03-30-2009, 04:04 AM
  5. Using find function to find entries in multiple cells
    By stanigator in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2007, 08:45 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