Inserting a formula in one cell depending on the drop down menu from another cell

My question is this, using Apple Numbers I want to insert a formula into one cell depending on the text of a drop down menu from another cell.

To be more specific, depending on the answer from a drop down menu in one cell (in my case this menu is cell N26), I want to have another cell that uses one of two formulas.

So if my drop down menu says "$60 per Wk" then I'd like the other cell to use the following formula "=SUM(240−N26)×2" (where N26 is the drop down list cell), or if the drop down list cell says "$75 per Wk", then use this formula "=SUM(300−N26)×2"


Is this possible and if so how?

Mac mini

Posted on Apr 4, 2024 3:29 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 4, 2024 4:56 PM

You could use the IFS function in this other cell but you'll need to change the values of the drop-down cell N26 to be only numerical, e.g. 60 and 75 (you could title the column "$ per kW" so that the meaning of the values is clear.)


For instance:

= IFS(N26 = 60, SUM(240−N26)×2, N26 = 75, SUM(300−N26)×2)

Similar questions

2 replies

Apr 4, 2024 7:20 PM in response to Glenn_Bloke

Glenn_Bloke wrote:

if my drop down menu says "$60 per Wk" then I'd like the other cell to use the following formula "=SUM(240−N26)×2" (where N26 is the drop down list cell), or if the drop down list cell says "$75 per Wk", then use this formula "=SUM(300−N26)×2"


You can do something like this:


=SWITCH(REGEX.EXTRACT(N26,"\d+"),"60",(240−REGEX.EXTRACT(N26,"\d+"))*2,"75",(300−REGEX.EXTRACT(N26,"\d+"))*2)


All the regex bit does is extract the number from the Pop-Up Menu.


But it seems your formula is too complicated. Firstly, you don't need the SUM in any case. Secondly, the calculations seem simplify to just multiply by 6, like this:


=REGEX.EXTRACT(N26,"\d+")*6



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


SG

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.

Inserting a formula in one cell depending on the drop down menu from another cell

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