How to use len AND search at the same time?

Mr2017

Well-known Member
Joined
Nov 28, 2016
Messages
644
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I'd like to use the len and search functions in ONE formula.

Scenario: I have a spreadsheet where users can input up to 4 characters in a column and they mean a specific thing eg "Jane Fonda"

But then they'd only mean that if they contained EITHER a single number or a combination of numbers and a full stop eg 5.50

Does anyone know how I can create a formula that counts the number of characters in a cell AND checks to see if the cell has at least one number?

If the cell didn't contain any numbers, then I'd want to return the word "non-numeric."

To give you a simple example,

"1" or "5.50" in cell A1 should return "Jane Fonda" in cell B1
But ABC in cell A2 should return "non-numeric" in cell B2.

I've used the LEN function to count the number of characters in a cell, but the problem is that if someone types in anything random that's less than 5 characters, then the formula fails - so I need to check two conditions:

i) less than 5 characters
ii) AND contains a number

Thanks in advance.
 
You're welcome, thanks for the feedback.
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,216,101
Messages
6,128,844
Members
449,471
Latest member
lachbee

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top