Macro that gets rid of brackets in formula as in the example.

cezar1984

New Member
Joined
Apr 3, 2019
Messages
1
Hello,

First time here, as I can't find the answer I'm looking for browsing the internet.

Is there a way of writing a macro in excel that does this ?

How do I get from this: (A/B/C)+(D/E)
To this: A+D or A+E or B+D or B+E or C+D or C+E

This is just an example, the macro I want to write is to basically get rid of the brackets and make the combinations based on order of operations and algebra, if that makes any sense.

Example 2:

Before: ((A/B)+C))+(D/E)
After: A+C+D or A+C+E or B+C+D or B+C+E

I don't need the final result, A B C D E are not numbers, they are options, I only need the longer version of the formula without the brackets.

Example from what I need to do (manually without macro):
I have option in this format with brackets:
((EN-YV/EN-XW/EN-XX)+(DGADD/DGAEG/DGAA8))/((EN-XW/EN-XX)+DGAC4)
Eliminating the brackets, this becomes:
DGAA8_PLUS_EN_XW or DGAA8_PLUS_EN_XX or DGAA8_PLUS_EN_YV or DGAC4_PLUS_EN_XW or DGAC4_PLUS_EN_XX or DGADD_PLUS_EN_XW or DGADD_PLUS_EN_XX or DGADD_PLUS_EN_YV or DGAEG_PLUS_EN_XW or DGAEG_PLUS_EN_XX or DGAEG_PLUS_EN_YV

Please help if it's possible.

Thank you.
Cezar
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top