+ Reply to Thread
Results 1 to 3 of 3

Calcualte percentage based on text value in another cell

  1. #1
    Registered User
    Join Date
    08-14-2009
    Location
    Lincoln, England
    MS-Off Ver
    MS Office 2019 Professional Plus
    Posts
    60

    Calcualte percentage based on text value in another cell

    Hi all,

    I have a formula to calculate a percentage or leave blank if there is no value, =IF(R5="","",R5/20)

    I need to change this because instead of 20 always being the number to be divided by, it will now depend on the text in another cell. If Q5 is 'S' then it needs to divide by 50, if Q5 is 'C' or 'H' then it needs to divide by 40. I feel like I'd be able to do this if it wasn't for the fact I already have an IF statement in the formula. If anyone could help, I'd really appreciate it.

    Thanks,
    Dom

  2. #2
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: Calcualte percentage based on text value in another cell

    Try this:

    =IF(R5="","",R5/lookup(Q5,{"C","H","S"},{40,40,50}))

    I see that you have never marked a thread as solved, so the below is advice on expected forum etiquette. Thank you.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    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.

  3. #3
    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. 2407 (Windows 11 23H2 64-bit)
    Posts
    84,036

    Re: Calcualte percentage based on text value in another cell

    Or:

    =IF(R5="","",R5/IF(OR(Q5="C",Q5="H"),40,IF(Q5="S",50,1))

    See above about how to sign off your thread.

+ 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] Capping percentage of one cell based on percentage of another
    By jtinsley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-21-2021, 05:17 AM
  2. formula in excel to calcualte percentage of completion for a task
    By Real_Madrid in forum Excel - New Users/Basics
    Replies: 17
    Last Post: 07-22-2015, 07:06 AM
  3. [SOLVED] Calcualte Percent when cell equals N/A
    By SVTF in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-26-2013, 11:00 PM
  4. [SOLVED] Getting a formula to calcualte only of the lenth of the string in a cell is more than 3
    By jshaw82 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-22-2013, 08:03 AM
  5. Replies: 2
    Last Post: 04-04-2013, 12:44 AM
  6. Replies: 0
    Last Post: 02-06-2013, 10:22 AM
  7. formula to calcualte number based on several factors
    By shlomo821 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2013, 08:23 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