Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Let say I have 2 Columns (A = Section, B=Class).
Section Class Value Section1 A 1 Section2 B 1 Section3 A 1 Section2 D 1 Section1 B 1 Section2 A 1 Section1 B 1 Section1 E 1 Section1 A 1 Section2 A 1 The result I want is : Column A,B, C - is sorted, but if Section and Class is the same, only one will be displayed and the value is added in column C. The result will be : Section Class Value Section1 A 2 Section1 B 2 Section1 E 1 Section2 A 2 Section2 B 1 Section2 D 1 Section3 A 1 Would apreciate your help. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have a look at pivot tables...that should do what you want.
OJ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
' assum,es tabel in C1-Enn
Option Explicit Sub Sections() Dim index With Range(Range("C1"), Range("E1").End(xlDown)) .Sort Key1:=Range("C2"), Order1:=xlAscending, _ Key2:=Range("D2"), Order2:=xlAscending, _ Header:=xlGuess For index = Range("E1").End(xlDown).Row To 3 Step -1 If Cells(index, "C") = Cells(index - 1, "C") Then If Cells(index, "D") = Cells(index - 1, "D") Then Cells(index - 1, "E") = Cells(index - 1, "E") + Cells(index, "E") Rows(index).Delete End If End If Next End With End Sub "broogle" wrote: Let say I have 2 Columns (A = Section, B=Class). Section Class Value Section1 A 1 Section2 B 1 Section3 A 1 Section2 D 1 Section1 B 1 Section2 A 1 Section1 B 1 Section1 E 1 Section1 A 1 Section2 A 1 The result I want is : Column A,B, C - is sorted, but if Section and Class is the same, only one will be displayed and the value is added in column C. The result will be : Section Class Value Section1 A 2 Section1 B 2 Section1 E 1 Section2 A 2 Section2 B 1 Section2 D 1 Section3 A 1 Would apreciate your help. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formatting - sort of | Excel Worksheet Functions | |||
Some sort of conditional sum? | Excel Discussion (Misc queries) | |||
Sort of like SUMIF and COUNTIF - but return a conditional value | Excel Discussion (Misc queries) | |||
Conditional Sort? | Excel Discussion (Misc queries) | |||
Sort by conditional formats? | Excel Worksheet Functions |