Answered step by step
Verified Expert Solution
Question
1 Approved Answer
To summarize the work you have done above, write a function Percentages _ CSA using a LAMBDA that inputs a column of names ( e
To summarize the work you have done above, write a function PercentagesCSA using a LAMBDA
that inputs a column of names eg season names and produces a row of percentages for the
alphabetically sorted unique names. The percentages specify the fraction of total rows containing
a unique name eg Winter Test your function with the Season data in the Festivals worksheet.
Notice that the length of the row of percentages depends on the data and needs to be computed
dynamically. Use two implementations to write your function PercentagesCSA, the first using
FILTER and the second using the function PercentagesfromtableCSA given below. We
give you almost a complete FILTER solution because FILTER will be covered in detail in the next
topic. Call the function with the FILTER implementation PercentagesFILTERCSA. Call the
function with the table as an intermediate result PercentagestableCSA.
LAMBDANamesLET
SortedUnique,SORTUNIQUEUNKNOWN
CountOne,LAMBDAsROWSFILTERNamesNamess
CountsFILTER,MAPSortedUnique UNKNOWN
Percentages,CountsFILTERSUMUNKNOWN
Show,IFERRORHSTACKSortedUniqueCountsFILTER,Percentages
Result,TRANSPOSECHOOSECOLSShow
ResultWinter;"Summer";"Winter";"Spring";"Fall";"Winter";"Summer"
You complete this LAMBDA by changing UNKNOWN UNKNOWN UNKNOWN to the
correct names. For example, UNKNOWN needs to be the formal argument Names.
To test the function CountOne, I used the following LAMBDA.
LAMBDANamesLET
Comment"FunctionToTest",
CountOne,LAMBDAsROWSFILTERNamesNamess
PartialResult Names"Winter",
PartialResultFILTERNamesNames"Winter"
Test CountOneWinter
Test CountOneSummer
ArrayHeaders,HSTACKNamesPartialResultPartialResultTestTest
Show,IFERRORVSTACKArrayHeaders
HSTACKNamesPartialResult PartialResult Test Test
ShowWinter;"Summer";"Winter";"Spring";"Fall";"Winter"
The above LAMBDA for testing uses one Names column with six rows to show partial results
inside CountOne and run CountOne for "Winter" and "Summer". Your LAMBDA should look
like LAMBDANames LET where in the LET, you compute the intermediate results that
eventually lead to the final result. Document your function PercentagesFILTERCSA using the
design recipe linked in the syllabus prefix.
To simplify the implementation of your function PercentagestableCSA, we provide you
with a function called PercentagesfromtableCSA. It takes a table of and as input,
and it returns the percentage of the sum of all s per column across all columns.
LAMBDAT LET
counts,BYCOLTLAMBDADSUMD
percentages,countsSUMcounts
percentages
Learning to understand a formula written by someone else is a common task. Your task is to
learn from the Excel documentation or ChatGPT how BYCOL is defined and to use it to imple
ment PercentagesCSA by first producing a table of and and then processing it with Percent
agesfromtableCSA. In other words, we break PercentagesCSA into two steps: producing
and consuming a table of and
Put the function PercentagesfromtableCSA into a separate worksheet but you dont have
to formally document it using the design recipe.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started