Req, Tricky column formula

S

stge

I have a column 'AO' with numbers 1-9 in rows AO1:AO9 being recovery
days.
I also have columns 'AR'-'AX' with the number of people i.e.
2,0,2,2,0,0,0. in the first row, representing people on the days of the
week
in the next row I have 4,4,0,0,0,0,0,
and so on for the 9 rows.

My problem is that I need to get the result in columns AY1:BE9 the
result being:
If 'AO1'=1 day recovery and the number of people is 2,0,2,2,0,0,0 (from
above in columns AR1:AX1) the number of days should be placed in AY1:BE1
and the answer is 2.0.2.2.0.0.0

If 'AO2' = 2 days recovery and the number of people is 4,4,0,0,0,0,0
the number of days in columns AY2:BE2 should be 4,8,4,0,0,0,0

If 'AO8' = 3 recovery days and the number of people is 0,0,0,2,1,0,0
the number of days in columns AY3:BE3 should be 0,0,0,2,3,3,1

I hope you can understand what I am talking about as it is easier to
think about the problem than to write it.

Any help would be useful or if you wish any other info please let me
know.

Thanks
stge
 
S

sulprobil

Write in AY1:
=SUM(OFFSET(AR1,0,-MIN($AO1,COLUMN()-COLUMN($AY1)+1)
+1,1,MIN($AO1,COLUMN()-COLUMN($AY1)+1)))

and then copy to AZ1:BE1 and to AY2:BE9.

HTH,
sulprobil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top