Thread: Formula terror
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph David Biddulph is offline
external usenet poster
 
Posts: 618
Default Formula terror

"Fred Smith" wrote in message
...
"Creolekitten via OfficeKB.com" <u24383@uwe wrote in message
news:63a118c081863@uwe...
Hello and thank you so much. I'm trying to find out what the percentage
of C
& D combined would be of 20. I think I forgot some more of the formula
also
because at the same time if C3 + D3 is < or not equal to 20 I need to
calculate what percentage of the sum of C3 & D3 would be of 20%. If the
sum
is greater than or equal to 20 then the only value I want to print is 20
because that would max it but if less than 20 then what is the percentage
of
the sum of C3 and D3.


=20/(c3+d3)

is the percentage that c3+d3 is of 20.


You may prefer (c3+d3)/20 rather than 20/(c3+d3) ?

However, now you have a display problem, because if c3+d320, you want the
number 20 displayed, but if it's less, you want a percentage displayed. A
possible solution is to display only percentages using the formula:

=if(c3+d3=20,0.20,20/(c3+d3))

and format as percent.

If that's not what you want, give us specific examples of what you want
displayed in each circumstance.

There's always a solution.


Perhaps =MIN((c3+d3)/20,1) and format that as percentage, you'll get 100% as
the maximum when C3+D320. With Fred's solution [having inverted the
20/(c3+d3), see above], you'd get the same answer for a total of 4 as for
20, as both would show 20%

You could dispense with the formatting as percentage, and use
=IF(C5+D5=20,20,(C5+D5)/0.2&"%")
but that would give a text answer in the percentage case, so couldn't be
used for further calculations.
---
David Biddulph