Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unexpected Result Hardeep_kanwar[_2_] Excel Worksheet Functions 2 January 16th 09 03:29 PM
Unexpected Result with "If" Logic/Conditional Statement joeu2004 Excel Discussion (Misc queries) 1 July 5th 07 04:40 PM
Unexpected Result with "If" Logic/Conditional Statement Bill Ridgeway Excel Discussion (Misc queries) 1 July 3rd 07 07:07 PM
Unexpected result Biff Excel Worksheet Functions 5 June 3rd 05 02:56 AM
FileSearch gives unexpected result Stephen Allen[_2_] Excel Programming 2 December 21st 03 01:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"