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
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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
 
Upvote 0
Thank you, that was most helpful.

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

Regards,

Irfan
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A2").FormulaR1C1 = ActiveSheet.Name
End Sub
 
Upvote 0

Forum statistics

Threads
1,217,440
Messages
6,136,636
Members
450,022
Latest member
Joel1122331

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top