How to add multiple items in a single cell from a pop-up menu in Google Sheets?

I have a sheet that I am trying to add multiple items in the same cell from a pop-up menu.

Menu:


I would like to be able to add multiple items and have the value calculate the values.


[Re-Titled by Moderator]

Windows, Windows 10 (19045)

Posted on Feb 14, 2025 9:25 AM

Reply

Similar questions

4 replies

Feb 14, 2025 10:45 AM in response to HurricaneFreis

Pop-up menus only allow single selections - you can't choose multiple items from a single popup in a single cell.


If you can get past that, you can use REGEX to match the cell "apple, orange, banana" to separate values.


For example, given the following (I put the Fruits into a separate table so they don't get in the way of the main sheet):


(Note: this is based on a Numbers spreadsheet, but should translate to Google Sheets easily enough)



First, I used SUBSTITUTE() to replace the comma/spaces in the cell with "|", a logical OR separator for regular expressions:


=SUBSTITUTE($A2,", ","|")


This (internally) results in a string that looks like "apple|orange|banana". This can be used as a REGEX() (regular expression) in a SUMIF statement. In this case, cell B2 in the main table looks like:


=SUMIF(Fruits:A,REGEX(SUBSTITUTE($A2,", ","|"),FALSE),Fruits::B)


This checks all the values in column A on the Fruits table against the regular expression, for each match, it adds the corresponding value in the Value (B) column of the Fruits table.


There are some caveats here - it is very dependent on the format of the string... "apple,orange" wouldn't work, for example, although a more complex REGEX() and/or SUBSTITION() could handle that. it also won't double-up fruits (e.g. "apple, apple" would be counted as 1, not 2). Hopefully it's enough to get you started.



Feb 14, 2025 1:47 PM in response to HurricaneFreis

> I would have to have multiple columns with each value, and then sumif those together.


I don't understand this statement.. my post shows an example of one cell containing "apples, orange, banana" and generating the sum of corresponding lookup values from an adjacent table/range of cells.


At some point you have to maintain a list of the core fruits and values, so that's not going to change. The only issue is really how to identify which values to add for any given choice.

Some of this may depend on format. For example, if the 'user' table had a series of checkboxes and the end user had to check which ones they wanted... is that sufficient?

Or maybe there's a limit on how many choices a user can make, in which case would a series of pop-up menus be sufficient?


Really, the only hard (well, impossible) part of your ask is for multiple selections from a menu, when only single menu selections are supported. You're going to have to cross that bridge for any solution.

Feb 14, 2025 1:41 PM in response to Camelot

I understand. I was hoping, since the last time this was asked was in 2022, that the functionality had been added with an update.


Basically, I would have to have multiple columns with each value, and then sumif those together.


Is there any other way, even if not using a PUM, that the user can select from a list of values without having to add more columns. I am trying to simplify for the non-tech folks. Telling them they have to type it in a very specific way will turn them away from the sheet.

Feb 14, 2025 2:22 PM in response to Camelot

Very sorry, I thought your example shows the fruits in the selection, but I assumed that the user has to type each fruit followed by a comma. Obviously, my sheet isn't about fruit, I just can't add what the values are, and they are complicated. So I wanted the user to have a list to choose from.


A series of PUM would be acceptable. I can break it down in there. How do I go about that?


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to add multiple items in a single cell from a pop-up menu in Google Sheets?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.