Create a JavaScript function that performs all the same calculations as provided in a Google Sheet
Budget: £20 – £250 GBP
I have a Google Sheet with two tabs. I need some JavaScript writing that encodes and implements the functionality of this sheet.
https://docs.google.com/spreadsheets/d/1708o_LWDiq7MRgLweC_85Eecub0OSTE1z7vjYe81ofg/edit?usp=sharing
The first tab (Source Data) contains rows of individual IDs, and multiple columns of fixed numbers. It's used as a data lookup source.
The second tab takes a series of input numbers (grouped into 4 different categories of different types, eg. float, int etc) and then each cell performs a calculation that combines the relevant input number with the data source cell in the first sheet.
For each of the 4 groups, a total is calculated that is the average of each of the cells.
At the far right, the outputs of all four groups are multiplied with each other to produce a single percentage scoring factor for each ID.
I need a single JavaScript function that encodes all the source data, and implements the maths provided in the spreadsheet.
The input to the formula should be a series of four arrays (one per group).
function matrixCalculation(
[int, int, int, int, int],
[int, int, int, int, int, int, int, int, int, int, int],
[float, float, float, float],
[int, int, int, int, int, int, int, int]
)
The output of the function should an array of string IDs (from the first column) but DESCEND SORTED by their total final scoring (as shown on the far right). So the first entry in the array might be R013, but that would be because it had the highest total ranking given the specific input values provided. The last string ID in the array should be the ID with the lowest scoring ranking. If two IDs have identical final scores, then it does not matter which one takes precedence.
eg. ["R013", "R099", "R005", ...(etc) ]
The function must not use any external libraries, frameworks, routines, third party APIs etc. I do not want a function that calls to Google's API to fetch the data. I want you to encode the data in the Google Sheet into a structure that is hard coded alongside your function in JavaScript.
https://docs.google.com/spreadsheets/d/1708o_LWDiq7MRgLweC_85Eecub0OSTE1z7vjYe81ofg/edit?usp=sharing
The first tab (Source Data) contains rows of individual IDs, and multiple columns of fixed numbers. It's used as a data lookup source.
The second tab takes a series of input numbers (grouped into 4 different categories of different types, eg. float, int etc) and then each cell performs a calculation that combines the relevant input number with the data source cell in the first sheet.
For each of the 4 groups, a total is calculated that is the average of each of the cells.
At the far right, the outputs of all four groups are multiplied with each other to produce a single percentage scoring factor for each ID.
I need a single JavaScript function that encodes all the source data, and implements the maths provided in the spreadsheet.
The input to the formula should be a series of four arrays (one per group).
function matrixCalculation(
[int, int, int, int, int],
[int, int, int, int, int, int, int, int, int, int, int],
[float, float, float, float],
[int, int, int, int, int, int, int, int]
)
The output of the function should an array of string IDs (from the first column) but DESCEND SORTED by their total final scoring (as shown on the far right). So the first entry in the array might be R013, but that would be because it had the highest total ranking given the specific input values provided. The last string ID in the array should be the ID with the lowest scoring ranking. If two IDs have identical final scores, then it does not matter which one takes precedence.
eg. ["R013", "R099", "R005", ...(etc) ]
The function must not use any external libraries, frameworks, routines, third party APIs etc. I do not want a function that calls to Google's API to fetch the data. I want you to encode the data in the Google Sheet into a structure that is hard coded alongside your function in JavaScript.