tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,210
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi everyone,
I'd like a macro that can do the following,
in cell H5 I will put a formula, the formulas will all be the same but will vary in size, you will see what i mean in a moment,
I want to take the dat in these formulas and turn them into grath type tables
with headers Low High Answers in cell B1,C1,D1
so this is an example if the formulas,
"=IF(AND(Q6>=21,Q6<=25),1.04,IF(AND(Q6>=26,Q6<=30),1,IF(AND(Q6>=31,Q6<=35),0.96,IF(AND(Q6>=36,Q6<=40),0.91,IF(AND(Q6>=41,Q6<=45),0.87,IF(AND(Q6>=46,Q6<=50),0.82,IF(AND(Q6>=51,Q6<=55),0.76,IF(AND(Q6>=56,Q6<=60),0.71,IF(AND(Q6>=61,Q6<=70),0.58,IF(AND(Q6>=71,Q6<=80),0.41))))))))))"
So heres what I want the macro to do,
go along the formula and find the first ">=" and take the number value after that (so the value beween that and "," and place it in column B (B2)
then carry on along the formula and find "<=" take the number value after that (so the value beween that and ")" and place it in column C (C2)
then find ), and take that value and put it in column D (D2) and carry on until all the ands are in column B,C,D build out like a table
a small example of what i want is:
I'd like a macro that can do the following,
in cell H5 I will put a formula, the formulas will all be the same but will vary in size, you will see what i mean in a moment,
I want to take the dat in these formulas and turn them into grath type tables
with headers Low High Answers in cell B1,C1,D1
so this is an example if the formulas,
"=IF(AND(Q6>=21,Q6<=25),1.04,IF(AND(Q6>=26,Q6<=30),1,IF(AND(Q6>=31,Q6<=35),0.96,IF(AND(Q6>=36,Q6<=40),0.91,IF(AND(Q6>=41,Q6<=45),0.87,IF(AND(Q6>=46,Q6<=50),0.82,IF(AND(Q6>=51,Q6<=55),0.76,IF(AND(Q6>=56,Q6<=60),0.71,IF(AND(Q6>=61,Q6<=70),0.58,IF(AND(Q6>=71,Q6<=80),0.41))))))))))"
So heres what I want the macro to do,
go along the formula and find the first ">=" and take the number value after that (so the value beween that and "," and place it in column B (B2)
then carry on along the formula and find "<=" take the number value after that (so the value beween that and ")" and place it in column C (C2)
then find ), and take that value and put it in column D (D2) and carry on until all the ands are in column B,C,D build out like a table
a small example of what i want is:
Low | High | Answers | |
21 | 25 | 1.04 | |
26 | 30 | 1 | |
31 | 35 | 0.96 | |
etc. | |||