Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default If Statement returns true when false?

Here is the formula I am using
G21=5188
G22=10
G24=.12
G28=5188
G29-1556
=IF(G28<G22=SUM(G28:G29),G24*(G22-G21),IF(G22<G21,0,G29*G24))

Why does the statement start false and turn true? If it starts false
shouldn't it stay false no matter what the rest of the logical test says? So
what kind of logical test do i need to write so that if either part is false
then the statement is false?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 180
Default If Statement returns true when false?

If your intent is to require that G28<G22 and G22=SUM(G28:G29), put those
two tests inside an AND function:
=IF(AND(G28<G22,G22=SUM(G28:G29)),G24*(G22-G21),IF(G22<G21,0,G29*G24))

"Eric" wrote:

Here is the formula I am using
G21=5188
G22=10
G24=.12
G28=5188
G29-1556
=IF(G28<G22=SUM(G28:G29),G24*(G22-G21),IF(G22<G21,0,G29*G24))

Why does the statement start false and turn true? If it starts false
shouldn't it stay false no matter what the rest of the logical test says? So
what kind of logical test do i need to write so that if either part is false
then the statement is false?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,090
Default If Statement returns true when false?

I don't think that formula is written to do what you want it to do. State
in words what you want that formula to do. In detail. HTH Otto
"Eric" wrote in message
...
Here is the formula I am using
G21=5188
G22=10
G24=.12
G28=5188
G29-1556
=IF(G28<G22=SUM(G28:G29),G24*(G22-G21),IF(G22<G21,0,G29*G24))

Why does the statement start false and turn true? If it starts false
shouldn't it stay false no matter what the rest of the logical test says?
So
what kind of logical test do i need to write so that if either part is
false
then the statement is false?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default If Statement returns true when false?

I think you need an AND statement:

=IF(AND(G28<G22,G22=SUM(G28:G29),G24*(G22-G21),IF(G22<G21,0,G29*G24))

"IF G28 is less than G22 AND G22 is greater than the SUM of G28:G29, THEN
multiply G24 by (G22 - G21), ELSE IF G22 is less than G21, THEN 0, ELSE G29
times G24." Is that the logic you're looking for? If it is, then the
formula above is what you want.

Dave
--
Brevity is the soul of wit.


"Eric" wrote:

Here is the formula I am using
G21=5188
G22=10
G24=.12
G28=5188
G29-1556
=IF(G28<G22=SUM(G28:G29),G24*(G22-G21),IF(G22<G21,0,G29*G24))

Why does the statement start false and turn true? If it starts false
shouldn't it stay false no matter what the rest of the logical test says? So
what kind of logical test do i need to write so that if either part is false
then the statement is false?

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
Macro to Import Text Miasha Excel Discussion (Misc queries) 8 August 18th 06 04:30 PM
Please Help Me with Custom menus Mr BT Excel Worksheet Functions 7 July 4th 06 05:15 PM
Stop renaming or moving sheet tabs sparx Excel Discussion (Misc queries) 9 May 16th 06 08:44 PM
Removing Rows for Printing Frick Excel Worksheet Functions 20 March 10th 06 10:53 PM
Help: runtime error - Method seriescollection object_chart failed huangx06 Charts and Charting in Excel 3 July 9th 05 12:27 AM


All times are GMT +1. The time now is 06:20 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"