Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Extracting Data (Updated)

I realise that in my earlier post it may have been too
much to read so I have tried to simplify it:

Suppose I have the following set-up

UNAVAILABILITY
A B C D E F ....
1 Unit Amount 1-Feb 2-Feb 3-Feb 4-Feb ....
2 Maths £10 a
3 English £11 a ab b
4 Music £8 abc b abcde
5 P.E. £9
6 Geography £6 a
7 History £6
8 Drama £7
9 Science £12 a
... .
... .
... .

Now suppose that I want to add up the amount that is
attributed to "a" i.e:
£10 + £11 + £11 + £8 + £8 + £6 + £12 = £66.

Similarly, the total amount attributed to "b" i.e:

£11 + £11 + £8 + £8 + £8 = £46.

"c": £8 + £8 = £16.

"d": £8.

"e": £8.

How would I do this?

Can I use a for.. from...do loop?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Extracting Data (Updated)

Dim cell as Range, Tot as Double
for each cell in Range("C1:F9")
if instr(cell,"a") then
tot = tot + cells(cell.row,2).Value
end if
Next

--
Regards,
Tom Ogilvy



"Gary Thomson" wrote in message
...
I realise that in my earlier post it may have been too
much to read so I have tried to simplify it:

Suppose I have the following set-up

UNAVAILABILITY
A B C D E F ....
1 Unit Amount 1-Feb 2-Feb 3-Feb 4-Feb ....
2 Maths £10 a
3 English £11 a ab b
4 Music £8 abc b abcde
5 P.E. £9
6 Geography £6 a
7 History £6
8 Drama £7
9 Science £12 a
... .
... .
... .

Now suppose that I want to add up the amount that is
attributed to "a" i.e:
£10 + £11 + £11 + £8 + £8 + £6 + £12 = £66.

Similarly, the total amount attributed to "b" i.e:

£11 + £11 + £8 + £8 + £8 = £46.

"c": £8 + £8 = £16.

"d": £8.

"e": £8.

How would I do this?

Can I use a for.. from...do loop?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Extracting Data (Updated)

Gary,

If your not too set on a programming solution and worksheet functions
will suffice.

=SUMPRODUCT((ISERROR(SEARCH(R1,R2))=FALSE)*(R3))

Whe
R1 is a cell containing the code to be found (ie a)
R2 is that may contain the code (in your example C2:F9)
R3 is the range containing the amount (in your example B2:B9)

So if you had your data in A1:L9 and starting in A12 your summary

Code Total
a 66
b 46
c 16
d 8
e 8

The formula in B13 should be
=SUMPRODUCT((ISERROR(SEARCH(A13,$C$2:$L$9))=FALSE) *($B$2:$B$9))
which could be dragged down through B17 to get all codes.

Dan E

"Gary Thomson" wrote in message ...
I realise that in my earlier post it may have been too
much to read so I have tried to simplify it:

Suppose I have the following set-up

UNAVAILABILITY
A B C D E F ....
1 Unit Amount 1-Feb 2-Feb 3-Feb 4-Feb ....
2 Maths £10 a
3 English £11 a ab b
4 Music £8 abc b abcde
5 P.E. £9
6 Geography £6 a
7 History £6
8 Drama £7
9 Science £12 a
... .
... .
... .

Now suppose that I want to add up the amount that is
attributed to "a" i.e:
£10 + £11 + £11 + £8 + £8 + £6 + £12 = £66.

Similarly, the total amount attributed to "b" i.e:

£11 + £11 + £8 + £8 + £8 = £46.

"c": £8 + £8 = £16.

"d": £8.

"e": £8.

How would I do this?

Can I use a for.. from...do loop?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trend Data From an updated column ExcelMat Excel Discussion (Misc queries) 0 April 28th 09 03:45 AM
extracting multiple updated data to one spreadsheet vennesse Excel Discussion (Misc queries) 0 February 12th 09 01:19 AM
Excel cells randomly don't get updated unless each cell is updated Lost in Excel Excel Discussion (Misc queries) 5 September 29th 08 06:56 PM
Summarizing updated external data Jordan[_2_] Excel Worksheet Functions 2 May 9th 08 02:59 AM
How to keep updated table of data ? Daniel761 Excel Discussion (Misc queries) 0 August 3rd 05 03:26 PM


All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"