Help with OR Function

Irfan

New Member
Joined
Nov 5, 2005
Messages
8
Can anyone please help...

I want to input a name into cell A1

For B1 I would like to use the IF funtion so that,

If the text in A1 = "Dave" OR "John" for B1 to display "Y" otherwise display "N" and for the "N" to be red coloured font, if that's possible.

Many thanks,

Irfan
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

nbrcrunch

Well-known Member
Joined
Jan 1, 2003
Messages
2,062
First look in Excel help for the OR operator to understand how it works.

Next research conditional formatting.

Your cell logic will essentially be:
=IF(OR(A1=[condition1],A1=[condition2]),"Yes","NO")

The conditional formatting logic in your formula cell will be: =B1=TRUE
and then choose your formatting.

Where [condition1] is the first name and
[condition2] is the second name

Here is a tutorial for learning logical operations:
http://www.functionx.com/excel/Lesson14.htm

Also, this website has a wealth of tutorial information you can use:
http://www.mrexcel.com/articles.shtml
 

Irfan

New Member
Joined
Nov 5, 2005
Messages
8
Thank you, that was most helpful.

Now would it be possible for the NO to come up in red???

Regards,

Irfan
 

Irfan

New Member
Joined
Nov 5, 2005
Messages
8
Another couple of quick questions, is there a formula to make the value of a particular cell be it's Row number...
E.g. for Cell A8 to display 8, for H14 to be 14, L39 to be 39, etc.


Also, is there a formula to make the value of a particular cell be the name of the worksheet it's in...
E.g. for Cell G12 in the Worksheet titled "2005" to display "2005"

Many thanks,

Irfan
 

nbrcrunch

Well-known Member
Joined
Jan 1, 2003
Messages
2,062

ADVERTISEMENT

I already answered your 2nd question in the first post.

You can answer most of these questions by typing the word "functions" into the help search. In my system the very first top find is "Worksheet functions listed by category."

Look at the "Information" and "Lookup / Reference" functions

Specifically, Look at ADDRESS, ROW, COLUMN
 

Irfan

New Member
Joined
Nov 5, 2005
Messages
8
OK, it's taken a while, but I've worked out most of those.

But I still can't find the formula for a cell to display the name of the Worksheet it's in. Could you please just tell me the formula.

Many thanks,

Irfan
 

dantb

Active Member
Joined
Mar 20, 2002
Messages
358
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A2").FormulaR1C1 = ActiveSheet.Name
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,118,462
Messages
5,572,260
Members
412,451
Latest member
newbie22922792
Top