View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Francis[_2_] Francis[_2_] is offline
external usenet poster
 
Posts: 69
Default How do I sum the last 5 nonzero numbers in a row?

I have misread your request, you want to sum the last five non zero columns
instead of rows, try this array formula in U2 ( the 21st column), confirm by
Ctrl, Shift and Enter
=SUM(T2:INDEX(A2:T2,LARGE(COLUMN(A2:T2)*(A2:T2<0) ,5)))
--
Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked

Thank You

cheers, francis

Am not a greek but an ordinary user trying to assist another



"Francis" wrote:

try this array formula, confirm by Ctrl, Shift and Enter

assume your data is in column A

=SUM(OFFSET($A$1,LARGE(IF($A$1:$A$100<0,ROW($A$1: $A$100)),5)-1,0,100,1))
--
Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked

Thank You

cheers, francis

Am not a greek but an ordinary user trying to assist another



"crabatin" wrote:

I have values in a table and want to add a column on the right that will look
to the left at the previous 20 columns and find the last 5 numbers
(rightmost) that are not zero and sum them.