View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default formula to add values for all the same first words in cells in a r

Assuming your data in A1:B100
Criterias in:
C1: holds Bangladish
C2: holds Bangladish Mob
and so on....

=SUMPRODUCT(--(LEFT($A$1:$A$100,LEN(C1))=C1),$B$1:$B$100)
copy down

"SAM" wrote:

I have the range of data like the following:

Description

Column A Column B
UAE Mobile 21
UAE 22
Bangladish-Sylhet (2) 33
Bangladish Mob 26
Bangladish Mob (1) 15
Bangladish Mob (2) 29
Bangladish Mob (3) 98

I want the totals of values in column B for the similar values in column A
to be added up. Now I need different stages of totals:

1- I need totals for all the values in column A where the first word is the
same. For example Bangladesh. But Bangladesh is separated from the
remaining text in some cases by a "space" and in some cases by "-".

2- Second I need subtotal for all the values in column A where the first two
words are the same. For example Bangladesh Mobile or Bangladesh-Sylhet. In
these cases the words are separated in the first instance by a "space" and in
the second one by the "-".

3- I want further subtotal where the first three words of the value in
column A are the same and so on and so on.........

Ny help URGENTLY!

Thanks

SAM