DEV Community

Cover image for #128 — Use Formulas to Handle Association in Excel
3 1 1 1 1

#128 — Use Formulas to Handle Association in Excel

Problem description & analysis:

Here below is an Excel file book1.xlsx, which stores employees’ meal data. Part of the data is as follows:

source table

Task: Calculate the values in column C according to the following pricing rules 👇

calculation rule

Solution:

Since there are only a few rows in this table, we can enumerate them in the formula directly. Use SPL XLL and enter in cell C2:

=spl("=case(?1,""breakfast"":10,""lunch"":15,""supper"":20)",B2)
Enter fullscreen mode Exit fullscreen mode

The result is:

result table

Then drag C2 down to every relevant row:

final results


Download esProc Desktop for FREE and enhance 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

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs