English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi I need to have an If function that works like this:

=IF(C4="Yes", "=(10-A1)", Ok)

The bit that does not work is the forumla. Is there a way to make a formula work in an If function? If there is tell me how to do it please. If not how could i get reults similar to an if function using a different method. Thanks

Hearmenowinfo

2007-10-31 07:52:20 · 4 answers · asked by Anonymous in Computers & Internet Software

Also how do you don greater than or equal to?

I know you can do it in conditional formatting how do you do it in if functions

2007-10-31 08:28:06 · update #1

4 answers

You need

=IF(C4="Yes", (10-A1), "Ok")

you were so close - just a couple of misplaced quotation marks

2007-10-31 08:06:07 · answer #1 · answered by ? 2 · 0 0

the correct formula would be:
=IF(C4="Yes",SUM(10-A1),"Ok")

the errors in your formula are:

» quotes are only used to enclose text strings, not functions. so by putting "=(10-A1)" as the condition (if c4 is equal to yes) it is trying to insert text, not a calculation - because of the quotes.

» the Ok is placed in quotes because it's a text string that we want placed into the cell, and not a function - however "ok" could equally be replaced with a function (without quotes).

basically if you enclose something within quotes excel will treat is as text rather than a number or cell reference or function, and if you DON'T enclose a text string in quotes it will think it's a function.

doing either or both of the above the wrong way round will make the formula fail completely.

EDIT:
=IF(C4>5,SUM(10-A1),"Ok")
=IF(C4<5,SUM(10-A1),"Ok")
=IF(C4=5,SUM(10-A1),"Ok")
=IF(C4<>5,SUM(10-A1),"Ok")
=IF(C4>=5,SUM(10-A1),"Ok")
=IF(C4<=5,SUM(10-A1),"Ok")

the first is greater than 5, the second is less than 5, the third is equal to 5, the fourth is not equal to 5, fifth is greater than or equal to 5, then less than or equal to 5 - the number 5 can be replaced with a cell reference where needed.

2007-10-31 14:58:04 · answer #2 · answered by piquet 7 · 2 0

Actually both of the first two answers are a little longer than they need be. All you need is:

=IF(C4="Yes", 10-A1, "Ok")

You don't need SUM like the first answer states and you don't need the parenthesis like the second answer states.

2007-11-08 07:35:02 · answer #3 · answered by devilishblueyes 7 · 0 0

You've been given the correct function now, but if you wanted greater than or equal to it is >=

2007-10-31 16:51:10 · answer #4 · answered by Anonymous · 0 0

fedest.com, questions and answers