Process Worksheet With Two Formulas

Thomas Scott

New Member
Joined
Nov 7, 2021
Messages
11
Office Version
  1. 2019
Platform
  1. Windows
I want to use 2 formulas (normalization) and binarization on the same worksheet. I tried concatenating them in a single cell and that does not work so I assume a VBA macro is needed. My thinking, as a novice, is that should be something like this:
Sub Binarize ()
’Dimension the range & specify the worksheet for input
’Primary data will be numbers as well as ranged array
’Binarized data will all be integers or numbers without decimal values

‘ Normalize the worksheet
=(Prime2!B2-MIN(Prime2!B:B))/(MAX(Prime2!B:B)-MIN(Prime2!B:B))

’Binarize the normalized array (mean+/- 1SD for unity)
=IF(AND(Prime2!B2<AVERAGE(Prime2!B:B)+STDEV.P(Prime2!B:B),Prime2!B2>AVERAGE(Prime2!B:B)-STDEV.P(Prime2!B:B)),1,0)
End Sub

BUT do not know enough Excel to go any further. Two sample mini-sheets are shown. I can do it with 3 worksheets easily but just want two, i.e., starting and result. Thanks.

Sample.xlsx
ABCD
1IDData1Data2Data3
2Case1323
3Case2123
4Case3123
5Case4311
6Case5111
7Case6311
8Case7211
9Case8231
Prime


Sample.xlsx
ABCD
1IDData1Data2Data3
2Case110.51
3Case200.51
4Case300.51
5Case4100
6Case5000
7Case6100
8Case70.500
9Case80.510
Analysis
Cell Formulas
RangeFormula
B2:D9B2=(Prime!B2-MIN(Prime!B:B))/(MAX(Prime!B:B)-MIN(Prime!B:B))
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I don't think you need VBA, but need some clarifications.
1) There are different definitions of Binarizing. Can you state in words what your definition is?
2) What are you trying to concatenate?

It would be helpful if you could show a manual calculation as an example.
 
Upvote 0
I needed the ranged data in order to submit to hierarchical cluster analysis using Euclidean distance where values in the entire dataset (ranged or binary) had be within the range of 0-1. Now I discovered that binarizing the ranged data was unnecessary as the binarizing formula used mean +/- SD so one gets the same binarized result and thus binarizing the ranged was not necessary, thus no need for double stacking two formulas or holding results in an array as the problem is now solved. Thanks
 
Upvote 0
@Thomas Scott in future please do mark a post as the solution when it does not contain one. Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,025
Members
452,542
Latest member
Bricklin

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