To have simple equations in a all in one formula

Fin Fang Foom

Well-known Member
Hi everyone,

I have another dilema. I dont want to use that helper column ( C ). I tried to have a all in one formula. Like:

=(SUM(B2:B28*1.2)/SUM(A2:A28))

But I get a vaule error. The correct answer is: 2644.338

Any ideas how to get the formula work above?
Book2
ABCD
1RateRate pcs per hour
22205.1123.06
32198.17118.902
42144.4686.676
52173.5104.1
62144.4686.676
72144.4686.676
8150.9361.116
92144.4686.676
102173.96104.376
11183.78100.536
126441.7388.346
131102.55123.06
146615.28123.056
152144.4686.676
162135.3481.204
172199.28119.568
181102.55123.06
19167.3680.832
20167.3680.832
216441.7388.346
222144.4686.676
232126.7276.032
248820.4123.06
258820.4123.06
261696072
272144.4686.676
281102.55123.06
292644.338#VALUE!
Sheet1

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

almagg

Well-known Member
you were very close:

=SUM((B2:B28)*1.2/(A2:A28))

plus this is an array formula.
once you type in the cell you have to press:

CTRL+SHIFT+ENTER

this will put brackets around the whole expression.
note: putting brackets manually does not do it.

ravishankar

Well-known Member
HI
you can't have a formula that references the same cell (circular reference)
You can use a macro. It will overwrite col B. If that is OK, paste the following codes in the macro window ( alt f8)

Code:
``````x= cells(rows.count,1).end(xlUp).row
for a = 1 to x
cells(a,2) = cells(a,2)*1.2/cells(a,1)
next a``````
Try it on a copy of your data before you use it.
try =SUM(B2:B28)*1.2/SUM(A2:A28) to get the correct total.
Ravi

Fin Fang Foom

Well-known Member
you were very close:

=SUM((B2:B28)*1.2/(A2:A28))

plus this is an array formula.
once you type in the cell you have to press:

CTRL+SHIFT+ENTER

this will put brackets around the whole expression.
note: putting brackets manually does not do it.

Thank You almagg!

Replies
7
Views
84
Replies
2
Views
74
Replies
3
Views
229
Replies
5
Views
209
Replies
1
Views
154

1,181,728
Messages
5,931,696
Members
436,798
Latest member
spprtpplcm

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.

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

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