Posts Tagged ‘Formulas’

Why FIND when you can SEARCH

March 15th, 2010

Vinicius writes to ask:

"Dear Mr. Pig. I would like to know what the difference is between Excel's FIND and SEARCH. Which one should I use?"

I love the respect Vinicius shows by calling me Mr. Pig. Anyway, here is your answer Mr. Vinicius:

 

There are two differences between Excel's SEARCH and FIND functions.

 

First, the FIND function is case sensitive, while the SEARCH function is not.

As you can see in this example, the formula in D2 returns 13 because the FIND function is looking for the first Capital B. The first capital B just happens to be the 13th character.

The formula in cell D3 is using the SEARCH function. That function isn't case sensitivity, so it returns the first B it finds (character number 3).

 

 

The Second difference between FIND and SEARCH is the ability to use Wildcard characters. The SEARCH function handles wildcard characters, while the FIND function does not.

In this example, I'm using the (?) wildcard character to tell the SEARCH function to find the first string that starts with a B and ends with a C. The first string that meets my criteria starts on character 13, so that's what I get.

 

Which one should you use?

Technically, the SEARCH function is safer to use because you won't accidentally pull the wrong position due case sensitivity.

I don't think I've ever needed to do a case sensitive find. I'll never use the SEARCH function's wildcard ability, but it's nice that it's there.

 

I'll be honest; prior to this blog post, I used the FIND function mainly out of habit. In fact, prior to Vinicius' email, I kind of forgot about the SEARCH function.

I'm going to make an effort to use the SEARCH function from now on. Well Vinicius, I guess I'm recommending the SEARCH function.

A Color is Not Data

February 25th, 2010

Ok people. Repeat after me – "A color is not data".

Every so often I get a spreadsheet from someone who thinks that colors play a major role in data management. You know – those people who happily say "I tagged those records with Yellow". Oh really? I don't think my version of Excel has a "Yellow" data type.

  » More: A Color is Not Data

Excel Defunct Defaults

February 17th, 2010

A week ago, Dick Kusleika posted an excellent article outlining some Formula Tips.  I've already made plans to steal and use his ideas in my training.  But my plagiaristic habits are not the reason for this post.
?
.

» More: Excel Defunct Defaults

Paste Special Skip Blanks

January 28th, 2010

Today, I want to show you how to use the Skip Blanks option in the Paste Special dialog box. You've all probably seen it there, but you've never used it.

Here it is in the expertly placed square box.

» More: Paste Special Skip Blanks

Flipping a Range Upside Down

December 9th, 2009

I'm no Tiger Woods, but I get my share of lady fan mail. Today, I get an email from Dawn.

She asks: "Do you have an easy way to flip a range so that the bottom row is at the top and the top row is at the bottom?"

I have two methods for doing this.

  » More: Flipping a Range Upside Down

Copying VLOOKUPs Across Multiple Columns

November 10th, 2009

Nothing makes you feel like more of a monkey than manually adjusting formulas while, all along, you have the sense that you’re doing it the hard way.  This is the feeling you are likely to get when manually adjusting VLOOKUP formulas. 

. » More: Copying VLOOKUPs Across Multiple Columns

Protecting VLOOKUPS from Expanding Data

November 4th, 2009

I'm fresh back from the Excel Power Analyst Boot Camp we had here in Dallas. If you were there, thanks for all the great tips – I had lots of fun. If you weren't there, you missed quite the event. The Spice Girls showed up to talk about their new movie: Spice Racks. It was awesome. Lesson learned eh? Next time you'll join us.

 

One of the topics that kept surfacing at last week's event was the use of Tables/Lists. These are auto-expanding ranges that allow anything built on top of them to keep up with your data changes (similar to the dynamic named ranges you can create by using OFFSET and COUNTA, but much simpler). Today, I'll show you how to employ Tables/Lists to protect your VLOOKUPS from breaking when you add data to your lookup range.

  » More: Protecting VLOOKUPS from Expanding Data

Using the Switch Function in Excel

August 17th, 2009

I love using the Switch function in Access. It's a real timesaver in situations where complex nested IF functions are needed. Ever spend 10 minutes trying to get a nested IF formula right?

The Switch function allows for a easier method, evaluating a list of test expressions and returning the result for the first test that evaluates to true.

The basic syntax for the Switch function is: Switch2(Test1, Result1, Test2, Result2, etc…)

Here's an example.

» More: Using the Switch Function in Excel

Handling Different Data Types with One Chart

August 12th, 2009

Ahh…data types; Currency, Number, Percent. What a joy to have such a diverse set of numerical variations designed to make your life hell.

Anyone who has had to handle varying numerical formats knows how tedious it can be to build a reporting structure that can handle all formats.

If you've ever built one chart for Percents, one for Currencies, and one for Numbers, then you're reading the right blog post.

Today, I'll to show you a technique that allows one chart to accurately show any data type.

  » More: Handling Different Data Types with One Chart

Protect Worksheet Structure with Array Formulas

July 31st, 2009

In the another display of passive aggressive behavior, I want to show you a trick you can use to prevent anyone from adding or deleting rows or columns by using a simple array formula. 

I'm pretty sure I got this trick from Bob Umlas.  Most Bob tricks, they are extremely cool, but I never seem to find situations where I can use them.  But, maybe this trick will hit the spot for some of you.

. » More: Protect Worksheet Structure with Array Formulas