ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sort does not preserve string of additions (https://www.excelbanter.com/excel-worksheet-functions/92070-sort-does-not-preserve-string-additions.html)

HollywoodSam

Sort does not preserve string of additions
 
6/4/06 sam <at sign isiusa.com
Sort does not preserve string of additions
Ref rows 1-6 are original data
Ref rows 1-6 copied and sorted by date (col B)
Addition string is then incorrect

ref ORIGINAL DATA
1 4-Jun $1.00 fuel
2 3-Jun $1.00 fuel
3 3-Jun $50.00 other
4 1-Jun $1.00 fuel
5 2-Jun $1.00 fuel
6 Total "fuel" by "+" function $4.00

ref SORTED DATA
4 1-Jun $1.00 fuel
5 2-Jun $1.00 fuel
2 3-Jun $1.00 fuel
3 3-Jun $50.00 other
1 4-Jun $1.00 fuel
6 Total "fuel" by "+" function $53.00

Office Excel 2003 (11.8012.6568) SP2
Part of Office Professional Edition
--end



Ron Coderre

Sort does not preserve string of additions
 
If your data is arranged like this:
Col_A contains dates
Col_B contains amounts
Col_C contains categories

It seems like you're summing the fuel values by specific reference:

Example:
B6=B1+B2+B4+B5

Sorting won't change that kind of formula

Try something like this:
B6: =SUMIF(C1:C5,"fuel",B1:B5)

That will only sum the Col_B values where the Col_C value matches "fuel"

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"HollywoodSam" wrote:

6/4/06 sam <at sign isiusa.com
Sort does not preserve string of additions
Ref rows 1-6 are original data
Ref rows 1-6 copied and sorted by date (col B)
Addition string is then incorrect

ref ORIGINAL DATA
1 4-Jun $1.00 fuel
2 3-Jun $1.00 fuel
3 3-Jun $50.00 other
4 1-Jun $1.00 fuel
5 2-Jun $1.00 fuel
6 Total "fuel" by "+" function $4.00

ref SORTED DATA
4 1-Jun $1.00 fuel
5 2-Jun $1.00 fuel
2 3-Jun $1.00 fuel
3 3-Jun $50.00 other
1 4-Jun $1.00 fuel
6 Total "fuel" by "+" function $53.00

Office Excel 2003 (11.8012.6568) SP2
Part of Office Professional Edition
--end




All times are GMT +1. The time now is 09:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com