ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unexpected result from IF statement... Help with formula. (https://www.excelbanter.com/excel-programming/411137-re-unexpected-result-if-statement-help-formula.html)

Monomeeth

Unexpected result from IF statement... Help with formula.
 
Hi Joel

Thanks for your help. That solved the problem, but now I can't seem to nest
additional IF statements in the formula without an error?

The formula I now have is:

=IF(AB2=4,AB6),IF(AB2=5,AC6),IF(AB2=6,AD6),"")))

Any idea what I'm doing wrong now?

Also, would you happen to know if I can have the formular cater for twelve
values? The above formula only caters for three (i.e. 4, 5 or 6) but I will
need to eventually make it cater for twelve values from 1 to 12.

Thanks again for your help! It is much appreciated!

--
If you can measure it, you can improve it!


"Joel" wrote:

The today function returns a Number, You are testing for a string. They are
not equal.

from
=IF(AB2="5",AB6,"")
to
=IF(AB2=5,AB6,"")

"Monomeeth" wrote:

Okay, not sure why this isn't working so need your help.

In cell AA2 I have the following formula: =TODAY()
In cell AB2 I have the following formula: =MONTH(AA2)

Cell AA2 returns today's date. Cell AB2 returns the month of the date in
AA2. So far so good.

Now here's the problem:

In Cell C3 I have the following formula: =IF(AB2="5",AB6,"")

But for some reason this returns a blank result. Because we're in May, cell
AB2 does = 5, so that tells me that in cell C3 I should get the result of
whatever is in cell AB6. Cell AB6 has $35,500.00 in it, and this is what I
was expecting to get in cell C3.

I want to get this sorted out as I intend to have a nested IF statement to
allow for twelve possibilities ranging from 1 to 12.

Any suggestions of how to fix this? Or is there a better way to achieve the
same thing?

And, will I run into problems if I have twelve IF statements in my formula,
or will Excel handle that ok?

I'm using Excel 2003 SP2.

Thanks.

Joe.
--
If you can measure it, you can improve it!


Monomeeth

Unexpected result from IF statement... Help with formula.
 
Solved it - I think. I'm now using the following formula:

=IF(AB2=4,AB6,IF(AB2=5,AC6,IF(AB2=6,AD6,"")))

....and that seems to work.

Now, I guess I'll try it with twelve values and see what happens. Thanks for
your help Joel!


--
If you can measure it, you can improve it!


"Monomeeth" wrote:

Hi Joel

Thanks for your help. That solved the problem, but now I can't seem to nest
additional IF statements in the formula without an error?

The formula I now have is:

=IF(AB2=4,AB6),IF(AB2=5,AC6),IF(AB2=6,AD6),"")))

Any idea what I'm doing wrong now?

Also, would you happen to know if I can have the formular cater for twelve
values? The above formula only caters for three (i.e. 4, 5 or 6) but I will
need to eventually make it cater for twelve values from 1 to 12.

Thanks again for your help! It is much appreciated!

--
If you can measure it, you can improve it!


"Joel" wrote:

The today function returns a Number, You are testing for a string. They are
not equal.

from
=IF(AB2="5",AB6,"")
to
=IF(AB2=5,AB6,"")

"Monomeeth" wrote:

Okay, not sure why this isn't working so need your help.

In cell AA2 I have the following formula: =TODAY()
In cell AB2 I have the following formula: =MONTH(AA2)

Cell AA2 returns today's date. Cell AB2 returns the month of the date in
AA2. So far so good.

Now here's the problem:

In Cell C3 I have the following formula: =IF(AB2="5",AB6,"")

But for some reason this returns a blank result. Because we're in May, cell
AB2 does = 5, so that tells me that in cell C3 I should get the result of
whatever is in cell AB6. Cell AB6 has $35,500.00 in it, and this is what I
was expecting to get in cell C3.

I want to get this sorted out as I intend to have a nested IF statement to
allow for twelve possibilities ranging from 1 to 12.

Any suggestions of how to fix this? Or is there a better way to achieve the
same thing?

And, will I run into problems if I have twelve IF statements in my formula,
or will Excel handle that ok?

I'm using Excel 2003 SP2.

Thanks.

Joe.
--
If you can measure it, you can improve it!



All times are GMT +1. The time now is 05:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com