asked on # Is it possible to make a command such as =LEFT(), case specific in Excel?

Hello,

In Excel (2007), is it possible to make a command such as =LEFT(), case specific?

For example, suppose you are evaluating the first two characters in A1 & A2 with the following formula in A3:

=IF(LEFT(A1,2)=LEFT(A2,2),"YES","NO")

If A1 & A2 contain the following:

A1: October

A2: Octopus

A3: =IF(LEFT(A1,2)=LEFT(A2,2),"YES","NO")

then A3 will return: YES. Similarly, if the entry in A2 is changed as shown here:

A1: October

A2: octopus

A3: =IF(LEFT(A1,2)=LEFT(A2,2),"YES","NO")

then A3 will still return: YES

Is there any way to modify the formula in A3 so that it will detect the different case of the letter "O" and as a result, return "NO" in the second example?

Thanks

In Excel (2007), is it possible to make a command such as =LEFT(), case specific?

For example, suppose you are evaluating the first two characters in A1 & A2 with the following formula in A3:

=IF(LEFT(A1,2)=LEFT(A2,2),

If A1 & A2 contain the following:

A1: October

A2: Octopus

A3: =IF(LEFT(A1,2)=LEFT(A2,2),

then A3 will return: YES. Similarly, if the entry in A2 is changed as shown here:

A1: October

A2: octopus

A3: =IF(LEFT(A1,2)=LEFT(A2,2),

then A3 will still return: YES

Is there any way to modify the formula in A3 so that it will detect the different case of the letter "O" and as a result, return "NO" in the second example?

Thanks

Microsoft Excel

Log in or sign up to see answer

Become an EE member today7-DAY FREE TRIAL

Members can start a 7-Day Free trial then enjoy unlimited access to the platform

or

Learn why we charge membership fees

We get it - no one likes a content blocker. Take one extra minute and find out why we block content.

Not exactly the question you had in mind?

Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.

ask a question
You're right, NULL. I read that wrong. I read the Asker wanted to ignore case. UPPER would force that, but Excel does that anyway.

Steve_Brady, EXACT is the function you want; so NULL's answer is correct, mine is not.

NULL, why do you reverse the test and the True/False parts? Would not

=IF(EXACT(LEFT(A1,2),LEFT(A2,2)),"YES","NO")

be simpler?

Lee

Steve_Brady, EXACT is the function you want; so NULL's answer is correct, mine is not.

NULL, why do you reverse the test and the True/False parts? Would not

=IF(EXACT(LEFT(A1,2),LEFT(

be simpler?

Lee

And if you can be happy with a TRUE / False result instead, you can drop the if altogether.

=EXACT(LEFT(A1,2),LEFT(A2,2))

Thomas

=EXACT(LEFT(A1,2),LEFT(A2,

Thomas

I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst

William Peck

=IF(UPPER(LEFT(A1,2))=UPPE

Lee