I am trying to calculate the total for the PT colums. I want it to calculate the top 3 PT colums and add them together. Excell noob so hoping someone can point me in the right direction. You can see my attempt in the screenshot below
CodePudding user response:
=SUM(LARGE(IF(B1:P1="PT",B2:P2),{1,2,3}))
which may or may not require committing with CTRL SHIFT ENTER
, depending on your version of Excel.
CodePudding user response:
An alternative to Jos Woolley's answers which does not need the array formula entry as the function performs array operation is as follows:
=SUM(AGGREGATE(14,6,$B$2:$P$2/($B$1:$P$1=$S$1),{1,2,3}))
Note I set cell S1 to be a drop down list of possible column names instead of hardcoding the "PT" value.