Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Advanced if statements?

I need some help with nested if statements. What I need to write is
something of this format: if(A7="Grade1" and if(B7="Grade1"),"OK",
"Replace")), how do I write this in a nested if statement
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Advanced if statements?

=IF(AND(A7="Grade 1",B7="Grade 1"), "matched","not matched")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ralph" wrote in message
...
I need some help with nested if statements. What I need to write is
something of this format: if(A7="Grade1" and if(B7="Grade1"),"OK",
"Replace")), how do I write this in a nested if statement



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Advanced if statements?

Hi Ralph,

Try this (I'm assuming you want the result in the active cell?):

Sub IfProc()

If Range("A7") = "Grade2" And Range("B7") = "Grade1" Then
Application.ActiveCell = "OK"
Else
Application.ActiveCell = "Replace"
End If

End Sub

Best regards

John


"Ralph" wrote in message
...
I need some help with nested if statements. What I need to write is
something of this format: if(A7="Grade1" and if(B7="Grade1"),"OK",
"Replace")), how do I write this in a nested if statement



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 Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
too advanced to do? or can u help me?? Jay Adams Excel Worksheet Functions 3 October 9th 06 12:39 AM
Advanced Conditional Formatting Ideas Needed! (ok, maybe not that advanced...) shadestreet Excel Discussion (Misc queries) 2 July 21st 06 03:04 PM
advanced if????? taran Excel Worksheet Functions 5 August 3rd 05 04:38 PM
Advanced DDE Jeff Standen Excel Programming 0 August 12th 04 02:36 PM


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