ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to compare multiple cell values (https://www.excelbanter.com/excel-programming/331399-how-compare-multiple-cell-values.html)

Chirs

How to compare multiple cell values
 
I would like to know if there is a functionality that would let you compare
multiple cell values and indicate when a cell value is dissimilar. basically
i want to look at all the cells in a each column, if all the row values for a
given column are the same value then i want to hide the column, but if any of
the values are dissimilar then leave the column. the row count may change fom
sheet to sheet. thx for any assistance

Jim Thomlinson[_4_]

How to compare multiple cell values
 
This can be done with a fairly simple formula something like..

=IF(AND(A1=B1,B1=C1,C1=D1,D1=E1,E1=F1,F1=G1,G1=H1) , 0, 1)

This formula compares a row from Columns A through H and flags dissimilar
values with a 1. You can then just filter on this new column. Instead of 0
and 1 you can use true and false or some other flags if you want. The nice
part about this way is you can filter and unfilter whenever you want.
--
HTH...

Jim Thomlinson


"Chirs" wrote:

I would like to know if there is a functionality that would let you compare
multiple cell values and indicate when a cell value is dissimilar. basically
i want to look at all the cells in a each column, if all the row values for a
given column are the same value then i want to hide the column, but if any of
the values are dissimilar then leave the column. the row count may change fom
sheet to sheet. thx for any assistance


Chirs

How to compare multiple cell values
 
Let me clarify, i need something to compare values in the same column not
across columns, als0oi dont want a cell formula i need something that can be
used in code with variables.

"Jim Thomlinson" wrote:

This can be done with a fairly simple formula something like..

=IF(AND(A1=B1,B1=C1,C1=D1,D1=E1,E1=F1,F1=G1,G1=H1) , 0, 1)

This formula compares a row from Columns A through H and flags dissimilar
values with a 1. You can then just filter on this new column. Instead of 0
and 1 you can use true and false or some other flags if you want. The nice
part about this way is you can filter and unfilter whenever you want.
--
HTH...

Jim Thomlinson


"Chirs" wrote:

I would like to know if there is a functionality that would let you compare
multiple cell values and indicate when a cell value is dissimilar. basically
i want to look at all the cells in a each column, if all the row values for a
given column are the same value then i want to hide the column, but if any of
the values are dissimilar then leave the column. the row count may change fom
sheet to sheet. thx for any assistance


keepITcool

How to compare multiple cell values
 

I posted a routine today in thread
"Comparing Formulas between Worksheets"
that may be of use.

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Chirs wrote :

Let me clarify, i need something to compare values in the same column
not across columns, als0oi dont want a cell formula i need something
that can be used in code with variables.

"Jim Thomlinson" wrote:

This can be done with a fairly simple formula something like..

=IF(AND(A1=B1,B1=C1,C1=D1,D1=E1,E1=F1,F1=G1,G1=H1) , 0, 1)

This formula compares a row from Columns A through H and flags
dissimilar values with a 1. You can then just filter on this new
column. Instead of 0 and 1 you can use true and false or some other
flags if you want. The nice part about this way is you can filter
and unfilter whenever you want.
--
HTH...

Jim Thomlinson


"Chirs" wrote:

I would like to know if there is a functionality that would let
you compare multiple cell values and indicate when a cell value
is dissimilar. basically i want to look at all the cells in a
each column, if all the row values for a given column are the
same value then i want to hide the column, but if any of the
values are dissimilar then leave the column. the row count may
change fom sheet to sheet. thx for any assistance



All times are GMT +1. The time now is 02:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com