You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

If , then execute formula

I have a "pop-up window" (drop-down list) that has three types of storage containers in it; a box, a file cabinet, and a folder. All store paper files. Each stores a different quantity. The box 2,000 pages. The file cabinet 10,000 and the folder 100 pages. Q: How can I execute a formula (if statement = box, then multiply by 2,000) based on a specific selection in the pop-up window?

iMac 27″ 5K, macOS 13.1

Posted on Mar 14, 2023 6:58 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 15, 2023 7:11 AM

If you want to keep your document nice and tidy, without extra tables, yet still be able to make easy edits, then you can consider using the SWITCH function.



=SWITCH(A2,"box",2000,"file cabinet",10000,"folder",100)


It's got multiple switch-value, if-match pairs, e.g. switch value in A2 is "box" then if-match is 2000 ,etc.


More on SWITCH here:


SWITCH - Apple Support.


You can also access this via Help > Formulas and Functions Help in your menu.


Use ; instead of , in the formula if your regions uses , as the decimal separator.


SG


6 replies
Question marked as Top-ranking reply

Mar 15, 2023 7:11 AM in response to ByronfromDataVault

If you want to keep your document nice and tidy, without extra tables, yet still be able to make easy edits, then you can consider using the SWITCH function.



=SWITCH(A2,"box",2000,"file cabinet",10000,"folder",100)


It's got multiple switch-value, if-match pairs, e.g. switch value in A2 is "box" then if-match is 2000 ,etc.


More on SWITCH here:


SWITCH - Apple Support.


You can also access this via Help > Formulas and Functions Help in your menu.


Use ; instead of , in the formula if your regions uses , as the decimal separator.


SG


Mar 15, 2023 12:27 AM in response to ByronfromDataVault




Your pop-up menu cells, in column C of Table 1, will have three items listed, plus a value to be returned if no value has been chosen for that cell.

The pop-up menu cells are placed in all rows of column B of table 1.


To construct the pop-up menus, enter the three item list in column A of Table 1, select the three cells, then click Format, then Cell in the right sidebar, then Start with, and choose Start with Blank. The pop-up menu can then be filled down column B as far as needed.


In Items, list the three types of container in column A, and the corresponding number of sheets in column B.


Enter the formula shown below Table 1 in cell C2 of Table 1, then fill it down for as many rows as you will need.



Regards,

Barry


If , then execute formula

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