LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 3 Oct 2007 00:18:09 +0530
Reply-To:     tata Birla <tata2birla@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         tata Birla <tata2birla@GMAIL.COM>
Subject:      how to get the sum of each column conditionally
Content-Type: text/plain; charset=ISO-8859-1

Hi All, I have an excel sheet (Attached). I need the simple data step solution to calculate the sum of each column in reverse order and each time we have to reduce one row from bottom.

For example please look at the attached excel sheet.

last variable value is sum I1 to I13 Last but one variable value is sum H1 to H13 Last but two variable value is sum G1 to G14 similarly the sum of F1 to F15, E1 to E 16, D1 to D17 and so on.

The solution should be generic preferably a macro

Thanks in advance.

Thanks Bhavani

7,173,628 7,226,628 7,266,538 7,301,392 7,298,881 7,322,943 7,326,330 7,334,853 7,340,600 8,815,940 8,788,992 8,876,295 8,841,857 8,878,514 8,867,913 8,823,520 8,827,088 8,837,223 9,861,805 9,864,788 9,780,643 9,762,508 9,713,368 9,700,823 9,720,391 9,714,941 9,735,660 6,108,633 6,063,898 6,088,184 6,089,768 6,079,420 6,064,611 6,084,448 6,096,240 6,121,572 9,655,377 9,901,280 9,864,551 9,966,443 10,073,262 10,233,092 10,445,264 10,493,589 10,540,089 10,930,116 11,036,610 11,043,863 11,118,632 11,306,878 11,345,670 11,346,973 11,394,399 11,264,687 10,622,168 10,975,065 10,898,284 11,003,416 11,036,892 11,100,131 11,107,994 11,138,640 11,174,859 12,306,230 13,051,657 13,634,083 13,553,087 13,941,681 13,973,245 13,854,495 13,926,884 14,043,954 16,805,794 18,121,714 18,552,282 19,414,236 20,333,625 20,424,650 20,432,567 20,364,983 20,132,865 20,082,891 20,956,957 21,263,458 21,572,470 21,647,472 21,748,533 21,705,281 22,389,025 22,625,101 23,004,107 23,228,121 23,253,697 23,427,814 23,293,864 23,294,637 23,032,633 23,215,249 23,232,345 21,396,426 22,241,411 22,464,476 22,466,196 22,576,698 22,575,307 23,253,744 23,802,055 23,731,439 17,164,695 17,299,695 17,527,369 17,507,190 17,589,218 17,629,346 17,940,533 17,869,542 17,919,449 22,761,568 22,820,796 22,770,304 22,549,758 22,713,702 22,693,710 22,486,778 22,633,910 0 21,530,644 21,658,319 22,529,839 22,344,119 22,299,394 22,435,500 22,655,456 0 0 24,785,070 24,716,850 24,796,868 24,829,014 24,895,411 24,874,990 0 0 0 32,279,135 33,085,491 33,646,634 33,867,901 34,171,765 0 0 0 0 42,709,286 44,124,864 46,608,709 47,370,327 0 0 0 0 0 46,136,244 45,852,739 48,479,157 0 0 0 0 0 0 19,337,587 19,023,366 0 0 0 0 0 0 0 19,223,206 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


Back to: Top of message | Previous page | Main SAS-L page