Computing.Net > Forums > Office Software > excel if statments

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

excel if statments

Reply to Message Icon

Original Message
Name: deride666
Date: March 31, 2004 at 13:44:46 Pacific
Subject: excel if statments
OS: WinXP Pro SP1
CPU/Ram: AMD XP 2500+/512mbs DDR33
Comment:

can anyone tell me wut is wrong with this if statement
=IF((H7<32183)*AND(H7>64368),H7,0)

thanx

//=\\Biohazard//=\\


Report Offensive Message For Removal


Response Number 1
Name: Jennifer SUMN
Date: March 31, 2004 at 15:19:12 Pacific
Reply: (edit)

Well, just a super quick glance. H7 can't be both less than 32183 and greater than 64368.


Report Offensive Follow Up For Removal

Response Number 2
Name: Report_2
Date: March 31, 2004 at 16:36:09 Pacific
Reply: (edit)

Following is the example I use when trying to remember how to use AND or OR within an IF statement:

=IF(OR(AND(A1>1,B1<10),C1=5),D1,0)

i.e. IF (A1>1 and B1<10) OR (C1=5) then return the value in D1 else return 0

This works in Excel 97 anyway.


Report Offensive Follow Up For Removal

Response Number 3
Name: Jennifer SUMN
Date: April 1, 2004 at 10:58:23 Pacific
Reply: (edit)

Troy's will work if he changes the logic to read >32183 and <64368. :)

Bryco, you're right too. Lots of ways to do the same thing. :)


Report Offensive Follow Up For Removal

Response Number 4
Name: Report_2
Date: April 1, 2004 at 14:11:58 Pacific
Reply: (edit)

I am a bit confused on the bolded portion below:
=IF((H7<32183)*AND(H7>64368),H7,0)

Can you clear it up for me?
Bryan


Report Offensive Follow Up For Removal

Response Number 5
Name: Jennifer SUMN
Date: April 2, 2004 at 11:15:58 Pacific
Reply: (edit)

K. The first part: =IF((H7<32183)*AND(H7>64368) is the logical test.

The IF statment: H7 is less than 32183 AND greater than 64368,

THEN the Cell value is equal to H7

The ELSE would be if the logical statement is false, then the cell value is 0

But, with that logical statment, H7 can't be both of those... :)

Got it? :)



Report Offensive Follow Up For Removal


Response Number 6
Name: Report_2
Date: April 7, 2004 at 06:28:59 Pacific
Reply: (edit)

I understand everything you wrote and agree wholeheartedly but I still do not understand the use of the asterik adjacent to the word AND in the statement.

Bryan


Report Offensive Follow Up For Removal






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software