View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Brad Brad is offline
external usenet poster
 
Posts: 846
Default Sort with IF functions?

Without using macros - an alternate solution would be to have a "helper" Column
with the formula
in C1 the value 1
In C2
=C1+(--AND(B1="TRUE",B2="FALSE"))

copy down

And then in column D
=SUMIF(C1:C9,1,A1:A9) - will give you the value 300

Changing the ,1, to ,2, - will give you the value 1200

Not exactly in the format you asked for but will give you the desired results.

If you want all the sums at once - copy the equation down several time -
make sure you lock down the ranges (ie $c$1:$c$9 and $a$1:$a$9) and let the
middle number change....

--
Wag more, bark less


"David P." wrote:

I didn't know what to put in the subject. Here is what I hope to do. As you
go down column B each time the cell equals false (based on an if function) it
will place the value in Column A (in the same row) one column over to the
right. This will allow me to add up each column seperately when it is sorted
this way. How in the world can this be done without some crazy macro? See an
explantion below. I would arrive at this type of scenario after an
alphabetical sort:

Column A B C D E F
A1 100 TRUE 100
A2 200 TRUE 200
A3 300 FALSE 300
A4 400 TRUE 400
A5 500 TRUE 500
A6 600 FALSE 600
A7 700 TRUE 700
A8 800 TRUE 800
A9 900 FALSE 900