From frequency to raw data

afndst

Board Regular
Joined
Sep 8, 2015
Messages
59
Office Version
  1. 365
Platform
  1. Windows
Hello


I am trying to get a one column array containing the the values of a frequency tabble class marks:


RawCF
112
#VALUE!​
=Y($C$3:$C$5;$D$3:$D$5)
121
232
3
3

I already tried several alternatives, but none of them worked.
I would appreciate help.

Function Y(R1, R2)

Dim fn As WorksheetFunction
Set fn = WorksheetFunction

Dim NR As Integer, N As Integer
Dim C(), F(), cF()
Dim X(), Z()

NR = R1.Rows.Count
N = fn.Sum(R1)

ReDim C(1 To NR), F(1 To NR), cF(1 To NR)
ReDim X(1 To N), Z(1 To N)

For i = 1 To NR
C(i) = R1.Item(i)
F(i) = R2.Item(i)
Next i

cF(1) = F(1)
For i = 2 To NR
cF(i) = cF(i - 1) + F(i)
Next i

For i = 1 To NR
For j = 1 To F(j)
X(j) = C(i)
Next j
Next i

Y = fn.Transpose(X)


End Function
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,216,116
Messages
6,128,933
Members
449,480
Latest member
yesitisasport

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