I have a problem in Excel 2007. I need to compare one value – letter “C” – to a range of cells that are on one row. The problem is that the values should be in every other cell.
So if I have a row like this – C 434 C 324 C 3453 – it should say in a cell in the end – OK
And if I have a row like this – C 22 B 665 C 8877 – it should say – error as not all are C’s.
Should be done as a formula not VBA.
So the question is is it possible to check if every other cell in a row ( a range ) contains a value C and output a value based on that.
PS! There are too many rows to do it by hand like this (pseudocode)
=IF(AND(A1=”C”; A3=”C”);”ok”;”error”)
Thanks
Here’s something you can try. It requires the use of some extra cells, but it should get the job done. Let’s say you start with this data:
… let’s say “Col_A” is in cell
A1, and the actual data starts in cellA2. Select cellA13and enter the following formula:Now click
A13and drag to the right to extend it toI13.Drag that whole range down to
A22:I22. You should have a field of ones and zeros in those cells now.Next, click cell
K2and enter the formula:Click cell
K2and drag it down to extend it toK11.That’s it; you can hide the block of cells with all the ones and zeros if you want.
Disclaimer: only tested in OO Calc. Should work in Excel too though.