Finding the last cell with value, with multiple criteria

KKaroullas

New Member
Joined
Feb 11, 2018
Messages
1
Hello All,

I need a formula that is able to find to the last value (Excluding 0 and empty cells) and then divide it by the divider next to it.
For example Allan's value must be -0.5 (row 8) because at the row 9 there is a 0.
Brian's value must be -0.06667 because row 20 is zero and row 19 is empty so the value must be tracked in row 18 and then divide it by the Divider. (-0.2/3=-0.06667).
Charles's value is the last row dividing it by the divider.

How can I built such a formula with this criteria?

NameDividerValue
1Allan5-1.4
2Allan4-1.7
3Allan3-0.4
4Allan2-0.1
5Allan20
6Allan2
7Allan2-0.3
8Allan1-0.5
9Allan10Allan-0.5

10

Brian

11
11Brian8-2
12Brian6-0.6
13Brian5-0.1
14Brian5-1.2
15Brian5-1.6
16Brian4
17Brian3-1.56667
18Brian3-0.2
19Brian2
20Brian20Brian-0.06667

21

Charles

8
22Charles70.1
23Charles5-0.4
24Charles5-0.83333
25Charles4-0.8
26Charles3-0.8
27Charles3-0.8
28Charles2-2.2
29Charles2-5.4
30Charles2-1.4
31Charles2-2Charles-1

<colgroup><col width="64" span="7" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the MrExcel board!

Try these, copied down.


Book1
ABCDEF
1NameDividerValue
2Allan5-1.4  
3Allan4-1.7
4Allan3-0.4
5Allan2-0.1
6Allan20
7Allan2
8Allan2-0.3
9Allan1-0.5
10Allan10Allan-0.5
11Brian11
12Brian8-2
13Brian6-0.6
14Brian5-0.1
15Brian5-1.2
16Brian5-1.6
17Brian4
18Brian3-1.56667
19Brian3-0.2
20Brian2
21Brian20Brian-0.066666667
22Charles8
23Charles70.1
24Charles5-0.4
25Charles5-0.83333
26Charles4-0.8
27Charles3-0.8
28Charles3-0.8
29Charles2-2.2
30Charles2-5.4
31Charles2-1.4
32Charles2-2Charles-1
Last Value
Cell Formulas
RangeFormula
E2=IF(A2=A3,"",A2)
F2=IF(E2="","",INDEX(C$2:C2,AGGREGATE(14,6,(ROW(C$2:C2)-ROW(C$2)+1)/((A$2:A2=A2)*(C$2:C2<>0)),1))/INDEX(B$2:B2,AGGREGATE(14,6,(ROW(C$2:C2)-ROW(C$2)+1)/((A$2:A2=A2)*(C$2:C2<>0)),1)))
 
Upvote 0
E2 like Peter suggests...

=IF(A2=A3,"",A2)

In F2 enter and copy down:

=IF($E2="","",LOOKUP(9.99E+307,1/($A$2:$A$32=$A2)/$C$2:$C$32,$C$2:$C$32/$B$2:$B$32))
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,028
Members
449,092
Latest member
ikke

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