Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default IF formula error

I'm getting the wrong values out of the following formula.
The variable to plug in a

E16 == 40000
B32 == 5000

The IF statement is:

=IF(E16 B32 & E16 60000, 30000, E16-B32)

It should give, from left to right:

E16 B32 returns TRUE
But
B32 is not 60000 so it returns FALSE
So Result is not 30000
but
E16 - B32 which is 35000

but I get 30000

I'm clearly handling the & wrongly. Would someone be kind enough
to put me straight?

TIA

Alan Secker

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default IF formula error

your critieria returns a string

TrueTrue or FalseTrue or TrueFalse

and is done with the And function

IF(And(E16 B32,E16 60000), 30000, E16-B32)

--
Regards,
Tom Ogilvy


"Alan Secker" wrote in message
...
I'm getting the wrong values out of the following formula.
The variable to plug in a

E16 == 40000
B32 == 5000

The IF statement is:

=IF(E16 B32 & E16 60000, 30000, E16-B32)

It should give, from left to right:

E16 B32 returns TRUE
But
B32 is not 60000 so it returns FALSE
So Result is not 30000
but
E16 - B32 which is 35000

but I get 30000

I'm clearly handling the & wrongly. Would someone be kind enough
to put me straight?

TIA

Alan Secker



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default IF formula error

I think you need to change the "&" to the word AND.

B32 & E16 will concatenate to 500040000

cheers,
Matt.

"Alan Secker" wrote in message
...
I'm getting the wrong values out of the following formula.
The variable to plug in a

E16 == 40000
B32 == 5000

The IF statement is:

=IF(E16 B32 & E16 60000, 30000, E16-B32)

It should give, from left to right:

E16 B32 returns TRUE
But
B32 is not 60000 so it returns FALSE
So Result is not 30000
but
E16 - B32 which is 35000

but I get 30000

I'm clearly handling the & wrongly. Would someone be kind enough
to put me straight?

TIA

Alan Secker



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default IF formula error

Thanks Matt. Alan

Matt. wrote:
I think you need to change the "&" to the word AND.

B32 & E16 will concatenate to 500040000

cheers,
Matt.

"Alan Secker" wrote in message
...

I'm getting the wrong values out of the following formula.
The variable to plug in a

E16 == 40000
B32 == 5000

The IF statement is:

=IF(E16 B32 & E16 60000, 30000, E16-B32)

It should give, from left to right:

E16 B32 returns TRUE
But
B32 is not 60000 so it returns FALSE
So Result is not 30000
but
E16 - B32 which is 35000

but I get 30000

I'm clearly handling the & wrongly. Would someone be kind enough
to put me straight?

TIA

Alan Secker





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
IF formula returns error; abbreviating the formula MZ Excel Discussion (Misc queries) 4 January 7th 10 11:02 PM
error with formula prem New Users to Excel 4 May 3rd 08 01:10 PM
Formula Error PR Excel Worksheet Functions 10 January 4th 08 08:07 PM
Error in Formula LaniG Excel Discussion (Misc queries) 2 May 29th 06 09:54 PM
How do I replace "#N/A" error, to continue my formula w/o error? Ali Khan Excel Worksheet Functions 2 February 20th 06 03:49 PM


All times are GMT +1. The time now is 04:01 PM.

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

About Us

"It's about Microsoft Excel"