Ask Your Question
0

if statment not working properly? or me?

asked 2016-01-25 19:14:04 +0100

quimkaos gravatar image

probably me... i just don't understand what i'm doing wrong. I trying to use fallowing formula, so any division by zero will be equal to zero, instead of an #DIV/0! error: =if(B19=0; 0; B23*100/B19) but instead of getting a 0 or the value, i get a #DIV/0! error if B19 is zero or a #NAME? error if B19 is any other number. What am i doing wrong here?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-01-27 08:29:53 +0100

pierre-yves samyn gravatar image

updated 2016-01-27 08:49:12 +0100

Hi

What you describe occurs if B19 is formatted as text. The solution is:

  • Right click B19▸Clear Direct Formatting
  • Type 0 or Delete or any value in B19

Note: you can use =IFERROR(B23*100/B19;0) instead of your formula.

Regards

edit flag offensive delete link more

Comments

thanks for the reply! it's working now... I don't really know if this was my issue. I noticed, after reopening the file, that my "formula" was working. It was converted from English to Portuguese: from IF to SE ( =SE(B19=0; 0; B23*100/B19) ). This native language translation of scripting languages is confusing. I keep imagining myself getting a job in France and having to program PHP/Javascript in a French version. Thanks for the IFERROR sugestion!

quimkaos gravatar imagequimkaos ( 2016-01-27 16:05:47 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-01-25 19:14:04 +0100

Seen: 45 times

Last updated: Jan 27 '16