Hi all,

Happy Friday!

How can you write a formula that will test if a cell begins with x, y, or z?

As always in Excel, there are different ways to approach this problem. I think the simplest way is to use the OR function with the LEFT function to perform the test. Then use the IF function to return a final result.

You can see this approach below, where the formula in cell D5 is:

=IF(OR(LEFT(B5,1)={"x","y","z"}),"x","")

Formula for if cell begins with x, y, or z

[Download the workbook and read the full explanation]

You might be curious about the {"x","y","z"} in the formula. That's called an "array constant," and it's a clever way to simplify the formula. The article above explains this idea in more detail. Click the link to download the workbook and give it a whirl yourself!

Excel formulas

The secret to mastering Excel formulas? Practice, practice, practice!

We've put together a list of over 500 working formulas right here for you to explore.

If you prefer a more structured approach, we've got you covered with video training. Each video is short (about 3 minutes) and provides a practice worksheet.

Have a great weekend!

Dave

 

Exceljet Logo
Exceljet
P.O. Box 4804
Salt Lake City, UT 84110

Copyright © 2023 Exceljet, All rights reserved.
You received this email because you are subscribed to our newsletter.
To unsubscribe, click the link below.