Second to last value from table with condition

Copper Contributor

Hi experts

 

Can you help me with the below?

 

I have a list of cash values in a table, example as follows by a rotating week number (1-4).

 

A ------------ B

1 ----------- 40

2------------- 30

3------------ 22

4 -----------56

1 -----------33

2 -----------15

3 -----------9

4------------40

1------------18

2------------79

3------------45

4------------61

 

What I want to do is have a formula to always pick out the second to last value corresponding to the week number. For example if I wanted the second to last value of week 4....

The formula would spit out = 40

 

If I wanted the second to last value of week 2....

The formula would spit out = 15

 

I have a formula to get the last value for each week... but second to last I am struggling with. I also need to mention the formula must ignore blank values!!!

 

Any help appreciated

 

Matt

40 Replies

i tried row() formula to get the row number in the adjacent cell and used this cell's reference as row number in your formula. It is working. @OliverScheurich