Dynamic IF calculations

Charles_

New Member
Joined
Dec 12, 2012
Messages
32
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 } p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 ; min-height: 14.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px} table.t1 {border-collapse: collapse} td.td1 {border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #aaaaaa #aaaaaa #aaaaaa #aaaaaa ; padding: 1.0px 5.0px 1.0px 5.0px} </style>Hi all,


I've been struggling on how to best convey my question by using the table below. Can you help me work out a formula for column B below, please?


Thank!




[TABLE="class: t1"]
<tbody>[TR]
[TD="class: td1"]

[/TD]
[TD="class: td1"]A
[/TD]
[TD="class: td1"]B
[/TD]
[TD="class: td1"]c
[/TD]
[/TR]
[TR]
[TD="class: td1"]1
[/TD]
[TD="class: td1"]Completed
[/TD]
[TD="class: td1"]Average
[/TD]
[TD="class: td1"]Projected - dynamically calculated
[/TD]
[/TR]
[TR]
[TD="class: td1"]2
[/TD]
[TD="class: td1"]20
[/TD]
[TD="class: td1"]=A2
[/TD]
[TD="class: td1"]=B2*4
[/TD]
[/TR]
[TR]
[TD="class: td1"]3
[/TD]
[TD="class: td1"]25
[/TD]
[TD="class: td1"]=SUM(A3+A2)/2
[/TD]
[TD="class: td1"]=B3*4
[/TD]
[/TR]
[TR]
[TD="class: td1"]4
[/TD]
[TD="class: td1"]

[/TD]
[TD="class: td1"]if A4 is blank, use latest available average in column B, in this case B3


If there is a value in A4:
=SUM(A4+A3+A2)/3
[/TD]
[TD="class: td1"]=B4*4
[/TD]
[/TR]
[TR]
[TD="class: td1"]5
[/TD]
[TD="class: td1"]

[/TD]
[TD="class: td1"]if A5 is blank, use latest available average in column B, in this case B3


If there is a value in A5:
=SUM(A5+A4+A3+A2)/4
[/TD]
[TD="class: td1"]= B5*4
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
=IF(ISBLANK(A4),B3,AVERAGE($A$2:A4))<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 } p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; color: #454545 ; min-height: 14.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px} table.t1 {border-collapse: collapse} td.td1 {border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #aaaaaa #aaaaaa #aaaaaa #aaaaaa ; padding: 1.0px 5.0px 1.0px 5.0px} </style>
 
Upvote 0
In B2 & fill down
=AGGREGATE(1,6,A$2:A2)
 
Upvote 0
In B2 & fill down
=AGGREGATE(1,6,A$2:A2)


Thanks Fluff, almost works like I needed!

The only issue I have is if I don't have a value on B2, then the formula breaks. I realise in the example above I had a value but I won't always have one, is this something you can help me with?
 
Upvote 0
How about
=IFERROR(AGGREGATE(1,6,A$2:A2),"")
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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