Matrix operations in Excel

Matrix operations in Excel

Back in the day, when we still used an abacus to double check our results in Excel, there was a cool feature well hidden from every day use: the matrix calculation. It still exists. You'd activate it by entering the formula in a cell with Control+Shift+Enter, and it would put {curly braces} around the formula to indicate that it operated in "matrix mode."


Formulas using matrix operations
Formulas using matrix operations

Here's the classic example. A table with price per unit and units sold. For total revenue we need to multiply the price on each row with the number of units, and then add the whole thing together.

Either you add an extra column with the multiplication to do that (not a bad iea to see the revenue per item in this case) but that's not always wanted, or there isn't even room for such a calculation. Matrix to the rescue!

The matrix operation is Take the four cells in B3:B6 and multiply them individually with the four cells in C3:C6 and then continue the calculation with those four values. You had to enter this as a matrix operation or Excel would choke on it.

The cool thing is... not anymore. In modern day Excel you can actually perform arithmetic on groups of cells, and Excel will process those calculations first and then work with the results. That's pretty cool!

For this particular example it would make more sense to use the SUMPRODUCT function of course, because that's what it's made for. And your coworker, or Future You, doesn't have to guess what that cryptic B3:B6*C3:C6 means or how it works. It's always better when your formula clearly communicates its intention, and nothing serves that purpose better than a function that does exactly what you want to achieve.

But... the ability to use matrix operations inside regular formulas opens up a whole universe of possibilities. More to follow on that!


要查看或添加评论,请登录

Bart Willems的更多文章

  • Navigating the risks of generative AI

    Navigating the risks of generative AI

    AI bots like ChatGPT and Copilot can be a fantastic tool in getting the job done. But you must always remember that…

  • What's in a (Excel) name?

    What's in a (Excel) name?

    With the advent of Excel Data Tables, “regular” named ranges might find less uses but that means they're far from…

    1 条评论
  • Multi-column XLookup

    Multi-column XLookup

    In the previous article we saw how Boolean algebra can be applied to matrix formulas to combine multiple selection…

  • Boolean logic with Excel Matrix Operations

    Boolean logic with Excel Matrix Operations

    In the previous article, Excel's matrix operations were discussed, and how nowadays we can perform matrix calculations…

  • The case against Pandas Pivot Tables

    The case against Pandas Pivot Tables

    When used to Excel, the pivot_table method in Pandas seems like a gift from the heavens. A simple, single command to…

社区洞察

其他会员也浏览了