mark de arce
mark de arce

Reputation: 1

IF function and nested function

Please help with this formula

=if(C27>=16000,16M,if(C27,=16999,16M,if(c27>=17000,17M,if(C27<=17999,17M,if(C27>=18000,18M,if(C27<=18999,18M,if(C27>=19000,19M)))))))

Upvotes: 0

Views: 40

Answers (3)

A.S.H
A.S.H

Reputation: 29352

=INT(C27/1000)&"M"

You may say I have to fix your formula and spot its obvious syntax error. No, I say you have to do it this way, and you always have to look for some neat, simple and deductive alternative before abandoning to the ugly, error-prone and difficult-to-maintain nested IFs.

And indeed, such alternative exists most of the time.

p.s. by the way why is it M and not K? may be you have a multiplicative unit implicitly in your data, well...

Upvotes: 2

Andy
Andy

Reputation: 21

=if(C27>=16000,16M,if(C27 ,= 16999,16M,if(c27>=17000,17M,if(C27<=17999,17M,if(C27>=18000,18M,if(C27<=18999,18M,if(C27>=19000,19M)))))))

the character before 16999 shows the wrong syntax, perhaps it's like this

=if(C27>=16000,16M,if(C27<=16999,16M,if(c27>=17000,17M,if(C27<=17999,17M,if(C27>=18000,18M,if(C27<=18999,18M,if(C27>=19000,19M)))))))

Upvotes: 0

Koby Douek
Koby Douek

Reputation: 16693

You have a type-o near 16999.

Try this:

=if(C27>=16000,16M,if(C27>=16999,16M,if(c27>=17000,17M,if(C27<=17999,17M,if(C27>=18000,18M,if(C27<=18999,18M,if(C27>=19000,19M)))))))

Upvotes: 0

Related Questions