Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

compare column character

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Compare a column to a character

Compare a column to a character

ResolvedVersion 2010

Josselin has attended:
Excel Advanced course
Excel VBA Intro Intermediate course

Compare a column to a character

I would like to know how to compare a column (any character in a column) to an other character, character being a number or text or logic function.
i.e. IF (A1:A10<>10, "All the numbers from the column A are different from 10", "There is at least one number from the column A equal to 10")

I look forward to hear from you.
Thanks,
Joss

RE: Compare a column to a character

Hi Joss

Thanks for getting in touch. I recommend you embed a COUNTIF function within your IF, like so.

=IF(COUNTIF(A1:A10,"=10")>0,"There is at least one number from the column A equal to 10","All the numbers from the column A are different from 10")

In other words, "if you can count at least one 10, display the first message, otherwise the second".

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Excel tip:

Change the default location for opening and saving spreadsheets

If you are always opening spreadsheets from and/or saving documents to a specific location that is not My Documents, save time by setting this folder as the default for opening files from and saving files to.

Here's how:
1. Go to Tools - Options.

2. Select the General tab.

3. Enter the pathname of the folder you wish to make the default in the Default File Location box (hint: it will be easier to use Windows Explorer to navigate to this folder, then copy and paste the pathname from the address bar at the top of the Windows Explorer screen).

4. Click OK.

You have now changed the default folder for opening and saving spreadsheets.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.23 secs.