ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help with a multiple OR statement. (https://www.excelbanter.com/excel-discussion-misc-queries/98570-help-multiple-statement.html)

Pank

Help with a multiple OR statement.
 
I need to construct a multiple OR statement that looks at the first 5
characters of a cell (G16) and if it is Table, Day-T or Eveni, then
expression 1, otherwise expression 2.

Having asked a colleague, they have come up with:-

=IF(OR(LEFT(G16,5)="Table€¯,LEFT(G16,5)="Day-T€¯,
LEFT(G16,5)="Eveni),expression 1,expression 2)

Is there an easier way to write the above?

Any assistance offered would be welcome.

Regards

PM


Andrew Taylor

Help with a multiple OR statement.
 
You can use:

=IF(OR(LEFT(G16,5)={"Table","Day-T","Eveni"}),expression 1,expression
2)

entered as an array formula (Ctrl-Shift-Enter)

Andrew


Pank wrote:
I need to construct a multiple OR statement that looks at the first 5
characters of a cell (G16) and if it is Table, Day-T or Eveni, then
expression 1, otherwise expression 2.

Having asked a colleague, they have come up with:-

=IF(OR(LEFT(G16,5)="Table",LEFT(G16,5)="Day-T",
LEFT(G16,5)="Eveni),expression 1,expression 2)

Is there an easier way to write the above?

Any assistance offered would be welcome.

Regards

PM



Pank

Help with a multiple OR statement.
 
Andrew,

Thank U for your swift response.

Regards

PM

"Andrew Taylor" wrote:

You can use:

=IF(OR(LEFT(G16,5)={"Table","Day-T","Eveni"}),expression 1,expression
2)

entered as an array formula (Ctrl-Shift-Enter)

Andrew


Pank wrote:
I need to construct a multiple OR statement that looks at the first 5
characters of a cell (G16) and if it is Table, Day-T or Eveni, then
expression 1, otherwise expression 2.

Having asked a colleague, they have come up with:-

=IF(OR(LEFT(G16,5)="Table",LEFT(G16,5)="Day-T",
LEFT(G16,5)="Eveni),expression 1,expression 2)

Is there an easier way to write the above?

Any assistance offered would be welcome.

Regards

PM





All times are GMT +1. The time now is 02:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com