I am trying to distill/consolidate the number of formulas in a workbook. I would like to attempt to take a list of formulas (IMAGE A) and where ever the macro identifies a valid cell reference to either retain only the first instance of that formula or replace said cell reference with the term "CELLREFERENCE" (IMAGE C)
Examples (IMAGE B)
I have sorted through several posts, but have not found a solution. any help would be great. thanks in advance.
posts:
IMAGE A
IMAGE B
IMAGE C
Examples (IMAGE B)
I have sorted through several posts, but have not found a solution. any help would be great. thanks in advance.
posts:
Vb code to check if Excel formula contains a cell reference
Hi I am currently trying to write a code to check to see if the formula in a cell references another cell (cell custom named X_1) its for a uni project. Basicly the user inputs a formula into the cell (e.g. =sin(X_1)*sin(3.14159)) and I want the code to run only if the user references cell...
www.mrexcel.com
VBA Determining if a cell is Relative or Absolute
Hi all, Excel 97, VBA ... Is there a property or ??? to determine if a formula is absolute or relative?? ie: $A$1 or A1 Or does one have to look for the '$' ... Thanks -Enjoy fh : )_~
www.mrexcel.com
IMAGE A
sample_file.xlsx | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | INPUT LIST | ||||
2 | sheet | cell | formula | ||
3 | Formulas | B2 | =namerange1/namerange2 | ||
4 | Formulas | C2 | =namerange1/namerange2 | ||
5 | Formulas | D2 | =namerange1/namerange2 | ||
6 | Formulas | B3 | =namerange1/namerange2 | ||
7 | Formulas | C3 | =namerange1/namerange2 | ||
8 | Formulas | D3 | =namerange1/namerange2 | ||
9 | Formulas | B4 | =namerange1/namerange2 | ||
10 | Formulas | C4 | =namerange1/namerange2 | ||
11 | Formulas | D4 | =namerange1/namerange2 | ||
12 | Formulas | B5 | =namerange1/namerange2 | ||
13 | Formulas | C5 | =namerange1/namerange2 | ||
14 | Formulas | D5 | =namerange1/namerange2 | ||
15 | Formulas | B6 | =namerange1/namerange2 | ||
16 | Formulas | C6 | =namerange1/namerange2 | ||
17 | Formulas | D6 | =namerange1/namerange2 | ||
18 | Formulas | B7 | =namerange1/namerange2 | ||
19 | Formulas | C7 | =namerange1/namerange2 | ||
20 | Formulas | D7 | =namerange1/namerange2 | ||
21 | Formulas | B8 | =namerange10/B7 | ||
22 | Formulas | C8 | =namerange10/C7 | ||
23 | Formulas | D8 | =namerange10/D7 | ||
24 | Formulas | B9 | =namerange10/B8 | ||
25 | Formulas | C9 | =namerange10/C8 | ||
26 | Formulas | D9 | =namerange10/D8 | ||
27 | Formulas | B10 | =namerange10/B9 | ||
28 | Formulas | C10 | =namerange10/C9 | ||
29 | Formulas | D10 | =namerange10/D9 | ||
30 | Formulas | B11 | =namerange10/B10 | ||
31 | Formulas | C11 | =namerange10/C10 | ||
32 | Formulas | D11 | =namerange10/D10 | ||
33 | Formulas | B12 | =namerange10/B11 | ||
34 | Formulas | C12 | =namerange10/C11 | ||
35 | Formulas | D12 | =namerange10/D11 | ||
36 | Formulas | B13 | =namerange10/B12 | ||
37 | Formulas | C13 | =namerange10/C12 | ||
38 | Formulas | D13 | =namerange10/D12 | ||
39 | Formulas | B14 | =namerange10/B13 | ||
40 | Formulas | C14 | =namerange10/C13 | ||
41 | Formulas | D14 | =namerange10/D13 | ||
42 | Formulas | B15 | =namerange10/B14 | ||
43 | Formulas | C15 | =namerange10/C14 | ||
44 | Formulas | D15 | =namerange10/D14 | ||
45 | Formulas | B16 | =namerange10/B15 | ||
46 | Formulas | C16 | =namerange10/C15 | ||
47 | Formulas | D16 | =namerange10/D15 | ||
48 | Formulas | B17 | =namerange10/B16 | ||
49 | Formulas | C17 | =namerange10/C16 | ||
50 | Formulas | D17 | =namerange10/D16 | ||
51 | Formulas | B18 | =namerange4*namerange1 | ||
52 | Formulas | C18 | =namerange4*namerange1 | ||
53 | Formulas | D18 | =namerange4*namerange1 | ||
54 | Formulas | B19 | =namerange6*B18+namerange10 | ||
55 | Formulas | C19 | =namerange6*C18+namerange10 | ||
56 | Formulas | D19 | =namerange6*D18+namerange10 | ||
57 | Formulas | B20 | =namerange6*B19+namerange10 | ||
58 | Formulas | C20 | =namerange6*C19+namerange10 | ||
59 | Formulas | D20 | =namerange6*D19+namerange10 | ||
60 | Formulas | B21 | =namerange6*B20+namerange10 | ||
61 | Formulas | C21 | =namerange6*C20+namerange10 | ||
62 | Formulas | D21 | =namerange6*D20+namerange10 | ||
63 | Formulas | B22 | =namerange6*B21+namerange10 | ||
64 | Formulas | C22 | =namerange6*C21+namerange10 | ||
65 | Formulas | D22 | =namerange6*D21+namerange10 | ||
66 | Formulas | B23 | =namerange6*B22+namerange10 | ||
67 | Formulas | C23 | =namerange6*C22+namerange10 | ||
68 | Formulas | D23 | =namerange6*D22+namerange10 | ||
69 | Formulas | B24 | =namerange6*B23+namerange10 | ||
70 | Formulas | C24 | =namerange6*C23+namerange10 | ||
71 | Formulas | D24 | =namerange6*D23+namerange10 | ||
72 | Formulas | B25 | =namerange6*B24+namerange10 | ||
73 | Formulas | C25 | =namerange6*C24+namerange10 | ||
74 | Formulas | D25 | =namerange6*D24+namerange10 | ||
75 | Formulas | B26 | =namerange6*B25+namerange10 | ||
76 | Formulas | C26 | =namerange6*C25+namerange10 | ||
77 | Formulas | D26 | =namerange6*D25+namerange10 | ||
78 | Formulas | B27 | =namerange6*B26+namerange10 | ||
79 | Formulas | C27 | =namerange6*C26+namerange10 | ||
80 | Formulas | D27 | =namerange6*D26+namerange10 | ||
81 | Formulas | B28 | =namerange6*B27+namerange10 | ||
82 | Formulas | C28 | =namerange6*C27+namerange10 | ||
83 | Formulas | D28 | =namerange6*D27+namerange10 | ||
84 | Formulas | B29 | =namerange6*B28+namerange10 | ||
85 | Formulas | C29 | =namerange6*C28+namerange10 | ||
86 | Formulas | D29 | =namerange6*D28+namerange10 | ||
87 | Formulas | B30 | =namerange6*B29+namerange10 | ||
88 | Formulas | C30 | =namerange6*C29+namerange10 | ||
89 | Formulas | D30 | =namerange6*D29+namerange10 | ||
90 | Formulas | B31 | =IFERROR(namerange7/namerange3,$A$6) | ||
91 | Formulas | C31 | =IFERROR(namerange7/namerange3,$A$6) | ||
92 | Formulas | D31 | =IFERROR(namerange7/namerange3,$A$6) | ||
93 | Formulas | B32 | =IFERROR(namerange7/namerange3,$A$6) | ||
94 | Formulas | C32 | =IFERROR(namerange7/namerange3,$A$6) | ||
95 | Formulas | D32 | =IFERROR(namerange7/namerange3,$A$6) | ||
96 | Formulas | A2 | =namerange1/namerange2 | ||
97 | Formulas | A3 | =namerange1/namerange2 | ||
98 | Formulas | A4 | =namerange1/namerange2 | ||
99 | Formulas | A5 | =namerange1/namerange2 | ||
100 | Formulas | A6 | =namerange1/namerange2 | ||
101 | Formulas | A7 | =namerange1/namerange2 | ||
102 | Formulas | A8 | =namerange10/A7 | ||
103 | Formulas | A9 | =namerange10/A8 | ||
104 | Formulas | A10 | =namerange10/A9 | ||
105 | Formulas | A11 | =namerange10/A10 | ||
106 | Formulas | A12 | =namerange10/A11 | ||
107 | Formulas | A13 | =namerange10/A12 | ||
108 | Formulas | A14 | =namerange10/A13 | ||
109 | Formulas | A15 | =namerange10/A14 | ||
110 | Formulas | A16 | =namerange10/A15 | ||
111 | Formulas | A17 | =namerange10/A16 | ||
112 | Formulas | A18 | =namerange4*namerange1 | ||
113 | Formulas | A19 | =namerange6*A18+namerange10 | ||
114 | Formulas | A20 | =namerange6*A19+namerange10 | ||
115 | Formulas | A21 | =namerange6*A20+namerange10 | ||
116 | Formulas | A22 | =namerange6*A21+namerange10 | ||
117 | Formulas | A23 | =namerange6*A22+namerange10 | ||
118 | Formulas | A24 | =namerange6*A23+namerange10 | ||
119 | Formulas | A25 | =namerange6*A24+namerange10 | ||
120 | Formulas | A26 | =namerange6*A25+namerange10 | ||
121 | Formulas | A27 | =namerange6*A26+namerange10 | ||
122 | Formulas | A28 | =namerange6*A27+namerange10 | ||
123 | Formulas | A29 | =namerange6*A28+namerange10 | ||
124 | Formulas | A30 | =namerange6*A29+namerange10 | ||
125 | Formulas | A31 | =IFERROR(namerange7/namerange3,$A$6) | ||
126 | Formulas | A32 | =IFERROR(namerange7/namerange3,$A$6) | ||
127 | Formulas | A33 | =IFERROR(namerange7/namerange3,$A$6) | ||
128 | Formulas | A34 | =IFERROR(namerange7/namerange3,$A$6) | ||
129 | Formulas | A35 | =IFERROR(namerange7/namerange3,$A$6) | ||
130 | Formulas | A36 | =IFERROR(namerange7/namerange3,$A6) | ||
131 | Formulas | A37 | =A$2+A33 | ||
132 | Formulas | B37 | =B$2+B33 | ||
133 | Formulas | A38 | =A$2+A34 | ||
134 | Formulas | B38 | =B$2+B34 | ||
135 | Formulas | A39 | =A$2+A35 | ||
136 | Formulas | B39 | =B$2+B35 | ||
137 | Formulas | A40 | =A$2+A36 | ||
138 | Formulas | B40 | =B$2+B36 | ||
139 | Formulas | A41 | =A$2+A37 | ||
140 | Formulas | B41 | =B$2+B37 | ||
141 | Formulas | A42 | =A$2+A38 | ||
142 | Formulas | B42 | =B$2+B38 | ||
143 | Formulas | A43 | =A$2+A39 | ||
144 | Formulas | B43 | =B$2+B39 | ||
145 | Formulas | A44 | =1000+$D32 | ||
146 | Formulas | B44 | =1000+$D32 | ||
147 | Formulas | C44 | =1000+$D32 | ||
148 | Formulas | D44 | =1000+$D32 | ||
149 | Formulas | E44 | =1000+$D32 | ||
150 | Formulas | F44 | =1000+$D32 | ||
151 | Formulas | G44 | =1000+$D32 | ||
152 | Formulas | H44 | =1000+$D32 | ||
153 | Formulas | H45 | =1000+$D33 | ||
154 | Formulas | H46 | =1000+$D34 | ||
155 | Formulas | H47 | =1000+$D35 | ||
156 | Formulas | H48 | =1000+$D36 | ||
157 | Formulas | H49 | =1000+$D37 | ||
158 | Formulas | A49 | =namerange1/Sheet5!A14+Sheet5!A4/Formulas!A32 | ||
159 | Formulas | A50 | =namerange1/Sheet5!A15+Sheet5!A5/Formulas!A33 | ||
160 | Formulas | A51 | =namerange1/Sheet5!A16+Sheet5!A6/Formulas!A34 | ||
161 | Formulas | A52 | =namerange1/Sheet5!A17+Sheet5!A7/Formulas!A35 | ||
162 | Formulas | A53 | =namerange1/Sheet5!A18+Sheet5!A8/Formulas!A36 | ||
163 | Formulas | A54 | =namerange1/Sheet5!A19+Sheet5!A9/Formulas!A37 | ||
164 | Formulas | A55 | =namerange1/Sheet5!A20+Sheet5!A10/Formulas!A38 | ||
165 | Formulas | A56 | =namerange1/Sheet5!A21+Sheet5!A11/Formulas!A39 | ||
166 | Sheet5 | A3 | =A2+8 | ||
167 | Sheet5 | A4 | =A3+8 | ||
168 | Sheet5 | A5 | =A4+8 | ||
169 | Sheet5 | A6 | =A5+8 | ||
170 | Sheet5 | A7 | =A6+8 | ||
171 | Sheet5 | A8 | =A7+8 | ||
172 | Sheet5 | A9 | =A8+8 | ||
173 | Sheet5 | A10 | =A9+8 | ||
174 | Sheet5 | A11 | =A10+8 | ||
175 | Sheet5 | A12 | =A11+8 | ||
176 | Sheet5 | A13 | =A12+8 | ||
177 | Sheet5 | A14 | =A13+8 | ||
178 | Sheet5 | A15 | =A14+8 | ||
179 | Sheet5 | A16 | =A15+8 | ||
180 | Sheet5 | A17 | =A16+8 | ||
181 | Sheet5 | A18 | =A17+8 | ||
182 | Sheet5 | A19 | =A18+8 | ||
183 | Sheet5 | A20 | =A19+8 | ||
184 | Sheet5 | A21 | =A20+8 | ||
185 | Sheet5 | A22 | =A21+8 | ||
186 | Sheet5 | A23 | =A22+8 | ||
187 | Sheet5 | A24 | =A23+8 | ||
188 | Sheet5 | A25 | =A24+8 | ||
189 | Sheet5 | A26 | =A25+8 | ||
190 | Sheet5 | A27 | =A26+8 | ||
191 | Sheet5 | A28 | =A27+8 | ||
192 | Sheet5 | A29 | =A28+8 | ||
193 | Sheet5 | A30 | =A29+8 | ||
194 | Sheet5 | A31 | =A30+8 | ||
195 | Sheet5 | A32 | =A31+8 | ||
196 | Sheet5 | A33 | =A32+8 | ||
197 | Sheet5 | A34 | =A33+8 | ||
198 | Sheet5 | A35 | =A34+8 | ||
199 | Sheet5 | A36 | =A35+8 | ||
200 | Sheet5 | A37 | =A36+8 | ||
201 | Sheet5 | A38 | =A37+8 | ||
202 | Sheet5 | A39 | =A38+8 | ||
input_list |
IMAGE B
sample_file.xlsx | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | |||
21 | EXAMPLE | ||||||||||||||||
22 | |||||||||||||||||
23 | 1 | input = formula | |||||||||||||||
24 | 2 | output = (1) OR (2) | |||||||||||||||
25 | (1) | namerange10/B7 - in this option the first formula in the "group" is retained only | |||||||||||||||
26 | (2) | namerange10/CELLREFERENCE - cell reference is replaced with term "CELLREFERENCE" so that the list can simply be depupped | |||||||||||||||
27 | Type of cell ref. | translation | |||||||||||||||
28 | a. | =A1 | CELLREFERENCE | ||||||||||||||
29 | b. | =$A$2 | $CELL$REFERENCE | ||||||||||||||
30 | c. | =A$3 | CELL$REFERENCE | ||||||||||||||
31 | d. | =$A4 | $CELLREFERENCE | ||||||||||||||
32 | |||||||||||||||||
33 | |||||||||||||||||
34 | |||||||||||||||||
35 | |||||||||||||||||
36 | sample from each group | ||||||||||||||||
37 | (1) | =namerange10/B7 | |||||||||||||||
38 | (2) | =namerange10/CELLREFERENCE | |||||||||||||||
39 | |||||||||||||||||
40 | (1) | =namerange6*B18+namerange10 | |||||||||||||||
41 | (2) | =namerange6*CELLREFERENCE+namerange11 | |||||||||||||||
42 | |||||||||||||||||
43 | (1) | =IFERROR(namerange7/namerange3,$A$6) | |||||||||||||||
44 | (2) | =IFERROR(namerange7/namerange3,$CELL$REFERENCE) | |||||||||||||||
45 | |||||||||||||||||
46 | (1) | =namerange10/A7 | |||||||||||||||
47 | (2) | =namerange10/CELLREFERENCE | |||||||||||||||
48 | |||||||||||||||||
49 | (1) | =namerange6*A18+namerange10 | |||||||||||||||
50 | (2) | =namerange6*CELLREFERENCE+namerange11 | |||||||||||||||
51 | |||||||||||||||||
52 | (1) | =IFERROR(namerange7/namerange3,$A$6) | |||||||||||||||
53 | (2) | =IFERROR(namerange7/namerange3,$CELL$REFERENCE) | |||||||||||||||
54 | |||||||||||||||||
55 | (1) | =A$2+A33 | |||||||||||||||
56 | (2) | =CELL$REFERENCE+CELLREFERENCE | |||||||||||||||
57 | |||||||||||||||||
58 | (1) | =1000+$D32 | |||||||||||||||
59 | (2) | =1000+$CELLREFERENCE | |||||||||||||||
60 | |||||||||||||||||
61 | (1) | =namerange1/Sheet5!A14+Sheet5!A4/Formulas!A32 | |||||||||||||||
62 | (2) | =namerange1/Sheet5!CELLREFERENCE+Sheet5!CELLREFERENCE/Formulas!CELLREFERENCE | |||||||||||||||
63 | |||||||||||||||||
64 | (1) | =A2+8 | |||||||||||||||
65 | (2) | =CELLREFERENCE+9 | |||||||||||||||
input_list |
IMAGE C
sample_file.xlsx | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
3 | TYPE 1 | OR | TYPE 2 | ||||||
4 | sheet | cell | formula | sheet | cell | formula | |||
5 | Formulas | B8 | =namerange10/B7 | Formulas | B8 | =namerange10/CELLREFERENCE | |||
6 | Formulas | B19 | =namerange6*B18+namerange10 | Formulas | B19 | =namerange6*CELLREFERENCE+namerange11 | |||
7 | Formulas | B31 | =IFERROR(namerange7/namerange3,$A$6) | Formulas | B31 | =IFERROR(namerange7/namerange3,$CELL$REFERENCE) | |||
8 | Formulas | A8 | =namerange10/A7 | Formulas | A8 | =namerange10/CELLREFERENCE | |||
9 | Formulas | A19 | =namerange6*A18+namerange10 | Formulas | A19 | =namerange6*CELLREFERENCE+namerange11 | |||
10 | Formulas | A31 | =IFERROR(namerange7/namerange3,$A$6) | Formulas | A31 | =IFERROR(namerange7/namerange3,$CELL$REFERENCE) | |||
11 | Formulas | A37 | =A$2+A33 | Formulas | A37 | =CELL$REFERENCE+CELLREFERENCE | |||
12 | Formulas | A44 | =1000+$D32 | Formulas | A44 | =1000+$CELLREFERENCE | |||
13 | Formulas | A49 | =namerange1/Sheet5!A14+Sheet5!A4/Formulas!A32 | Formulas | A49 | =namerange1/Sheet5!CELLREFERENCE+Sheet5!CELLREFERENCE/Formulas!CELLREFERENCE | |||
14 | Sheet5 | A3 | =A2+8 | Sheet5 | A3 | =CELLREFERENCE+9 | |||
output_list |