How to do formula If a<-.1 and .1, return em dash, otherwise do x

G

Guest

I need to do a formua where IF E12/E10*100 is greater than (.1) AND less than
..1, Excel will return an em dash, otherwise (ROUND(E12/E10*100,1)
 
G

Guest

=IF(AND(E12/E10*100>-.1,E12/E10*100<.1),"--",ROUND(E12/E10*100,1))

I'm not sure if an em dash is two hyphens, so if it's not, replace the
characters between the double quotation marks with an em dash.

Dave
 
G

Guest

That is what I was using and it doesn't work. Here's the actual formula:

=IF(AND(N24/C10*100>(0.1),N24/C10*100<0.1),"—",ROUND(N24/C10*100,1))

It does not return an em dash. It appears to ignore the and array and go to
the rounding formula. Do I need to use brackets around the And statement?
 
G

Guest

With the actual formula:

=IF(AND(N24/C10*100<0.1,N24/C10*100>(0.1)),"—",ROUND(N24/C10*100,1))

Where N24 is 1,200 and C10 is 4,791,299, I get .02 on the old mechcanical
adding machine and .02 is definitely between -.1 and.1, so I'm not sure where
the wrinkle is. Excel doesn't show an error in the formula. It just doesn't
return the correct result.
 
G

Guest

I figured it out.

Get rid of the parentheses aroung the negative 1 and just put -1 there.
Recalculate.

Dave
 
G

Guest

No problem.

My guess is that it is good practice to use the negative sign to denote
negative numbers in formulas, as opposed to using parentheses.

Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top