Archive of Mr Excel Message Board

Back to Forms in Excel VBA archive index
Back to archive home

"IF" formula
Posted by Greg on December 05, 2001 11:53 AM
Is it possible to have a formula as the true or false value in an IF formula? What I want to do:
If the value in an adjacent cell is greater than or equals 12, then subtract 12 from that value and add the contents of another cell. If the value is less than 12, then add to that number the contents of another cell.
This doesn't work:
=(IF (C18>12, C12-12+D13, C18+D13))
Thanks!

| Check out our Excel Resources
|
 |
 |
Re: "IF" formula
Posted by Ben on December 05, 2001 11:59 AM
Your formula looks correct to me. I'm wondering why you're using C12 in the second argument instead of C18. Is it possible this is the cell you're trying to enter the formula in and you're getting a circular reference error?
What specifically is the error you're getting?

Try this
Posted by Tom Urtis on December 05, 2001 12:25 PM
As with Ben, I also do not understand why you have C12 in your formula, but try this formula instead, assuming C12 is a typo:
'=IF(C18>=12,C18-12+D13,C18+D13)

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.