Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Calculate data from different sheets

Hi,

I´m looking for a formula that will transfer certain data to different sheets.

For example:
Data in sheet 1
If cell a1=usk data in cell a2,a3...
Transfer data to sheet 2
If cell a1=ssk data in cell a2, a3...
Transfer data to sheet 3

The easiest way would be to make another column but this will make the sheet
to big to handle.

Regards
Stefan
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Calculate data from different sheets

You need a macro. Where does the data go in sheets 2 and 3?

"Stefan" wrote:

Hi,

I´m looking for a formula that will transfer certain data to different sheets.

For example:
Data in sheet 1
If cell a1=usk data in cell a2,a3...
Transfer data to sheet 2
If cell a1=ssk data in cell a2, a3...
Transfer data to sheet 3

The easiest way would be to make another column but this will make the sheet
to big to handle.

Regards
Stefan

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Calculate data from different sheets

The data in sheet 2 and 3 is an average of the data printed in sheet 1.
For example:
The average of a2-a5 in sheet 1 goes to a2 in sheet 2 if a1 in sheet 1 equal
ssk

You need a macro. Where does the data go in sheets 2 and 3?

"Stefan" wrote:

Hi,

I´m looking for a formula that will transfer certain data to different sheets.

For example:
Data in sheet 1
If cell a1=usk data in cell a2,a3...
Transfer data to sheet 2
If cell a1=ssk data in cell a2, a3...
Transfer data to sheet 3

The easiest way would be to make another column but this will make the sheet
to big to handle.

Regards
Stefan

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Calculate data from different sheets

I don't think your request is correct. I asume in sheet 1 the Type is in
column A and the values you want averaged is in column B to E. The averages
wil go in column A in the sheet specified.


Sub MoveData()

With Sheets("Sheet1")
RowCount = 1
Do While .Range("A" & RowCount) < ""

Select Case DataType

Case "USK"
Set Sht = Sheets("Sheet2")

Case "SSK"
Set Sht = Sheets("Sheet3")
End Select

LastRow = Sht.Range("A" & Rows.Count).End(xlUp).Row
Newrow = LastRow + 1

Set DataRange = .Range("B" & RowCount & ":E" & RowCount)
Average = WorksheetFunction.Average(DataRange)

Sht.Range("A" & Newrow) = Average

RowCount = RowCount + 1
Loop
End With


End Sub


"Stefan" wrote:

The data in sheet 2 and 3 is an average of the data printed in sheet 1.
For example:
The average of a2-a5 in sheet 1 goes to a2 in sheet 2 if a1 in sheet 1 equal
ssk

You need a macro. Where does the data go in sheets 2 and 3?

"Stefan" wrote:

Hi,

I´m looking for a formula that will transfer certain data to different sheets.

For example:
Data in sheet 1
If cell a1=usk data in cell a2,a3...
Transfer data to sheet 2
If cell a1=ssk data in cell a2, a3...
Transfer data to sheet 3

The easiest way would be to make another column but this will make the sheet
to big to handle.

Regards
Stefan

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Calculate data from different sheets

Thanks Joel, this will do it

"joel" wrote:

I don't think your request is correct. I asume in sheet 1 the Type is in
column A and the values you want averaged is in column B to E. The averages
wil go in column A in the sheet specified.


Sub MoveData()

With Sheets("Sheet1")
RowCount = 1
Do While .Range("A" & RowCount) < ""

Select Case DataType

Case "USK"
Set Sht = Sheets("Sheet2")

Case "SSK"
Set Sht = Sheets("Sheet3")
End Select

LastRow = Sht.Range("A" & Rows.Count).End(xlUp).Row
Newrow = LastRow + 1

Set DataRange = .Range("B" & RowCount & ":E" & RowCount)
Average = WorksheetFunction.Average(DataRange)

Sht.Range("A" & Newrow) = Average

RowCount = RowCount + 1
Loop
End With


End Sub


"Stefan" wrote:

The data in sheet 2 and 3 is an average of the data printed in sheet 1.
For example:
The average of a2-a5 in sheet 1 goes to a2 in sheet 2 if a1 in sheet 1 equal
ssk

You need a macro. Where does the data go in sheets 2 and 3?

"Stefan" wrote:

Hi,

I´m looking for a formula that will transfer certain data to different sheets.

For example:
Data in sheet 1
If cell a1=usk data in cell a2,a3...
Transfer data to sheet 2
If cell a1=ssk data in cell a2, a3...
Transfer data to sheet 3

The easiest way would be to make another column but this will make the sheet
to big to handle.

Regards
Stefan



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
calculate totals from added sheets des-sa[_2_] Excel Discussion (Misc queries) 7 July 16th 08 10:17 PM
Use excel to calculate a percentile from data in multiple sheets EmyG Excel Worksheet Functions 0 July 24th 07 03:40 AM
How to calculate percentage acroos sheets in a workbook tosh105 Excel Discussion (Misc queries) 5 April 27th 06 10:39 PM
new sheets by this pc cannot calculate formulas Jeffry61 Excel Discussion (Misc queries) 12 September 23rd 05 07:21 PM
calculate totals of 5 sheets on to 6th sheet. salvo Excel Worksheet Functions 1 March 25th 05 06:58 AM


All times are GMT +1. The time now is 08:56 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"