To have simple equations in a all in one formula

Fin Fang Foom

Well-known Member
Joined
Mar 20, 2005
Messages
598
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 Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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.
 
Upvote 0
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
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,384
Members
449,080
Latest member
Armadillos

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