Help with OR Function

Irfan

New Member

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

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

Thank you, that was most helpful.

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

Regards,

Irfan

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

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

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

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A2").FormulaR1C1 = ActiveSheet.Name
End Sub

Replies
7
Views
325
Replies
4
Views
266
Replies
5
Views
327
Replies
5
Views
218
Replies
4
Views
386

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.

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

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