Calcualte percentage based on text value in another cell

1. 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. 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.

3. 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))

There are currently 1 users browsing this thread. (0 members and 1 guests)

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