Wednesday, December 03, 2008   
  Search   
 
Register  Login  
Forums  
     Minimize  

Welcome to MeraWindows forums.

Thank you for being at the Microsoft Windows Community Site. You may have to register before posting in forums. It's absolutely free. After registering, you can get all the benefits available to our registered members, you can access our Downloads section, you can participate in contests, etc. You can post in forums in English as well as in Hindi, in fact we encourage you to use Hindi in your posts. If you have any problem with registration or login, please contact us.

     
  


 
  Microsoft Windows Forums  Microsoft Offic...  Microsoft Excel  Exscel Basics 2 Create conditional formulas
Previous Previous
 
Next Next
New Post 10/1/2008 2:44 AM
User is offline Vasu Jain
2968 posts
www.cyberDimensions.blogspot.com
Forum Guru




Exscel Basics 2 Create conditional formulas  

Testing whether conditions are true or false and making logical comparisons between expressions are common to many tasks. You can use the AND, OR, NOT, and IF function to create conditional formulas.

The IF function uses the following arguments.

 

 

Formula with the IF function

Formula with the IF function

Callout 1  logical_test: The condition that you want to check.

Callout 2  value_if_true: The value to return if the condition is true.

Callout 3  value_if_false: The value to return if the condition is false.

 

 

What do you want to do?

Create a conditional formula that results in a logical value (TRUE or FALSE)

Create a conditional formula that results in another calculation or in values other than TRUE or FALSE



Create a conditional formula that results in a logical value (TRUE or FALSE)

To do this task, use the AND, OR, and NOT functions, and operators (operator: A sign or symbol that specifies the type of calculation to perform within an expression. There are mathematical, comparison, logical, and reference operators.).

Example

The example may be easier to understand if you copy it to a blank worksheet.

ShowHow to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

     Note   Do not select the row or column headers.

    Selecting an example from Help

    Selecting an example from Help
  3. Press CTRL+C.
  4. In the worksheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Tools menu, point to Formula Auditing, and then click Formula Auditing Mode.
 
1
2
3
4
A
Data
15
9
8
Sprockets
Widgets
Formula Description (Result)
=AND(A2>A3, A2<A4) Is 15 greater than 9 and less than 8? (FALSE)
=OR(A2>A3, A2<A4) Is 15 greater than 9 or less than 8? (TRUE)
=NOT(A2+A3=24) Is 15 plus 9 not equal to 24? (FALSE)
=NOT(A5="Sprockets") Is A5 not equal to "Sprockets"? (FALSE)
=OR(A5<>"Sprockets",A6 = "Widgets") Is A5 not equal to "Sprockets" or A6 equal to "Widgets"? (TRUE)

Create a conditional formula that results in another calculation or in values other than TRUE or FALSE

To do this task, use the IF, AND, and OR functions.

Example

The example may be easier to understand if you copy it to a blank worksheet.

ShowHow to copy an example

  1. Create a blank workbook or worksheet.
  2. Select the example in the Help topic.

     Note   Do not select the row or column headers.

    Selecting an example from Help

    Selecting an example from Help
  3. Press CTRL+C.
  4. In the worksheet, select cell A1, and press CTRL+V.
  5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Tools menu, point to Formula Auditing, and then click Formula Auditing Mode.
 
1
2
3
4
A
Data
15
9
8
Sprockets
Widgets
Formula Description (Result)
=IF(A2=15, "OK", "Not OK") If the value in cell A2 equals 15, then return "OK". (OK)
=IF(A2<>15, "OK", "Not OK") If the value in cell A2 is not equal to 15, then return "OK". (Not OK)
=IF(NOT(A2<=15), "OK", "Not OK") If the value in cell A2 is not less than or equal to 15, then return "OK". (Not OK)
=IF(A5<>"SPROCKETS", "OK", "Not OK") If the value in cell A5 is not equal to "SPROCKETS", then return "OK". (Not OK)
=IF(AND(A2>A3, A2<A4), "OK", "Not OK") If 15 is greater than 9 and less than 8, then return "OK". (Not OK)
=IF(AND(A2<>A3, A2<>A4), "OK", "Not OK") If 15 is not equal to 9 and 15 is not equal to 8, then return "OK". (OK)
=IF(OR(A2>A3, A2<A4), "OK", "Not OK") If 15 is greater than 9 or less than 8, then return "OK". (OK)
=IF(OR(A5<>"Sprockets", A6<>"Widgets"), "OK", "Not OK") If the value in cell A5 is not equal to "Sprockets" or "Widgets", then return "OK". (Not OK)
=IF(OR(A2<>A3, A2<>A4), "OK", "Not OK") If 15 is not equal to 9 or 15 is not equal to 8, then return "OK". (OK)

"There are only '10' types of ppl in dis world. Those who understand BINARY and those who dont."

 
New Post 10/1/2008 8:23 AM
User is offline Ashish Mathur
89 posts
www.ashishmathur.com
Member




Re: Exscel Basics 2 Create conditional formulas  

Dear Vasu,

Thanks for sharing this. 


For Microsoft Excel trainings in India, please visit http://ashishmathur.com/training.aspx

Regards,

Ashish Mathur - View Ashish Mathur's profile on LinkedIn
Microsoft Excel MVP
www.ashishmathur.com

 
New Post 10/1/2008 1:49 PM
User is offline Vasu Jain
2968 posts
www.cyberDimensions.blogspot.com
Forum Guru




Re: Exscel Basics 2 Create conditional formulas  

 Ashish Mathur wrote

Dear Vasu,

Thanks for sharing this. 

 

i will be posting a screenshot as well...using conditional formulas


"There are only '10' types of ppl in dis world. Those who understand BINARY and those who dont."

 
Previous Previous
 
Next Next
  Microsoft Windows Forums  Microsoft Offic...  Microsoft Excel  Exscel Basics 2 Create conditional formulas


   Get Your Own E-Mail Account @MeraWindows.com Minimize  
New Page 1 New Page 1
Show your cool quotient with @merawindows.com email account