DEV Community

Cover image for #121 — Enumeration Grouping
Judith-Data-Processing-Hacks
Judith-Data-Processing-Hacks

Posted on

2 1 1 1 1

#121 — Enumeration Grouping

Problem description & analysis:

Here below is a data table:

source table

Task: We want to put Apple, Banana, and Orange in a group and name them Fruits, put Pork, Beef, and Mutton in a group and name them Meats, and put the rest of the goods in a group and name them Others. And then count the total sales of each group.

Solution:

Use SPL XLL and enter the following code:

=spl("=E(?1).groups(if([""Apple"",""Banana"",""Orange""].pos(Goods)!=null:""Fruits"", [""Pork"",""Beef"",""Mutton""].pos(Goods)!=null:""Meats""; ""Others""):Goods; sum(Sales):Sales)", A1:B14)
Enter fullscreen mode Exit fullscreen mode

The results are as follows:

result table


Download esProc Desktop for FREE and revolutionize your Excel workflow using SPL XLL!! 🚀✨⬇️

✨SPL download address: esProc Desktop FREE Download

✨Plugin Installation Method: SPL XLL Installation and Configuration

✨References to other rich Excel operation cases: Desktop and Excel Data Processing Cases

✨YouTube FREE courses: SPL Programming

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (1)

Collapse
 
judith677 profile image
Judith-Data-Processing-Hacks

👉 Don’t forget to follow up for more Excel tips and tricks!

Discord
Reddit

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more