ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Toggle Button (https://www.excelbanter.com/excel-worksheet-functions/90004-toggle-button.html)

NavEx

Toggle Button
 
Purpose: Wants to apply two different formulas in a cell, not simultaneously
Question: How can I use a toggle button to apply different formulas to a
cell or array?
Example: Difference of two values - Number and Percentage
or
Formula calculating yearly profit for 1st, 2nd, 3rd.............. year
and
formula calculating accumulated profit for 1st, 2nd, 3rd ............year

Max

Toggle Button
 
Here's a simple example set-up
to toggle formulas in a col using a forms combo box ..

Implemented sample is available at:
http://www.savefile.com/files/4325613
Toggling Formulas using a Forms Combo Box.xls

Source table assumed in A1: C4, eg:

Sales 2004 2005
Item1 10 11
Item2 12 13
Item3 10 17

Input 2 labels in say, I1:I2

Diff
%Diff

Draw a combo box from the forms toolbar
Right-click Format control, make the settings:

Input range: $I$1:$I$2
Cell link: $E$1
(col E can be hidden away)

Then place
in D1: =IF(E1=1,I1,I2)
in D2, copied down:
=IF(E$1=1,C2-B2,TEXT((C2-B2)/B2,"0%"))

Col D will show/compute either the Difference
or the % Difference in Sales 2004 - 2005,
depending on the selection made in the combo box

--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"NavEx" wrote:
Purpose: Wants to apply two different formulas in a cell, not simultaneously
Question: How can I use a toggle button to apply different formulas to a
cell or array?
Example: Difference of two values - Number and Percentage
or
Formula calculating yearly profit for 1st, 2nd, 3rd.............. year
and
formula calculating accumulated profit for 1st, 2nd, 3rd ............year



All times are GMT +1. The time now is 02:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com