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

resolvedResolved · Low Priority · Version 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:

Move to edge of data block

When data is held in a block, however large, use the Ctrl key with your cursors to move quickly to the far edge of the block. Works with all 4 direction keys.

View all Excel hints and tips


Server loaded in 0.07 secs.