Formula: Evaluate a range in a row - Count of cells (columns) that are within 10 of another

Rx_

Board Regular
Joined
May 24, 2011
Messages
52
[TABLE="width: 334"]
<tbody>[TR]
[TD="width: 100, bgcolor: transparent, align: right"]282.97
[/TD]
[TD="width: 87, bgcolor: transparent, align: right"]156.34
[/TD]
[TD="width: 78, bgcolor: transparent, align: right"]285.12
[/TD]
[TD="width: 92, bgcolor: transparent, align: right"]126.57
[/TD]
[TD="width: 88, bgcolor: transparent, align: right"]234.14
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, align: right"]285.89
[/TD]
[TD="bgcolor: transparent, align: right"]157.97
[/TD]
[TD="bgcolor: transparent, align: right"]285.71
[/TD]
[TD="bgcolor: transparent, align: right"]126.65
[/TD]
[TD="bgcolor: transparent, align: right"]234.17
[/TD]
[/TR]
</tbody>[/TABLE]

Row 1 above would count 4 - Column 1 matches column 3 within 10 and Column 4 matches 5
Each column represents Degrees 0 to 360 (around 40,000 records)
It is a quality assurance metadata for a sorting column. How often do these rotations come within 10 degrees of each other?
Note: I realize that 0 degrees (359 degrees to 3 degrees) is tough. There is a Master rotation that is always at 0 - not shown.
For those close to 0 degrees - I have already designed a custom column for that.

The idea is to find when those rotations not close to 0 degrees are within sync with each other.

[TABLE="width: 334"]
<tbody>[TR]
[TD="width: 100, bgcolor: transparent, align: right"]321.39
[/TD]
[TD="width: 87, bgcolor: transparent, align: right"]33.56
[/TD]
[TD="width: 78, bgcolor: transparent, align: right"]242.55
[/TD]
[TD="width: 92, bgcolor: transparent, align: right"]120.43
[/TD]
[TD="width: 88, bgcolor: transparent, align: right"]231.79
[/TD]
[/TR]
</tbody>[/TABLE]
No matches here within 10 of each other - a count of 0

[TABLE="width: 334"]
<tbody>[TR]
[TD="width: 100, bgcolor: transparent, align: right"]187.19
[/TD]
[TD="width: 87, bgcolor: transparent, align: right"]183.42
[/TD]
[TD="width: 78, bgcolor: transparent, align: right"]179.6
[/TD]
[TD="width: 92, bgcolor: transparent, align: right"]109.61
[/TD]
[TD="width: 88, bgcolor: transparent, align: right"]227.69
[/TD]
[/TR]
</tbody>[/TABLE]
Count of 3 First 3 columns are within 10 of another column.


[TABLE="width: 334"]
<tbody>[TR]
[TD="width: 100, bgcolor: transparent, align: right"]187.19
[/TD]
[TD="width: 87, bgcolor: transparent, align: right"]188.42
[/TD]
[TD="width: 78, bgcolor: transparent, align: right"]180.6
[/TD]
[TD="width: 92, bgcolor: transparent, align: right"]109.61
[/TD]
[TD="width: 88, bgcolor: transparent, align: right"]227.69
[/TD]
[/TR]
</tbody>[/TABLE]
Count of 3 first 3 columns - the key is not to double count.

Basically, there is a set Range (columns) of 5 columns with degrees (0 to 360).
From there when a column is within 10 degrees of any other column - add 1 to the count.
If there is a formula, great. I am not opposed to creating a VBA formula if necessary.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,222,749
Messages
6,167,967
Members
452,158
Latest member
MattyM

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