Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,069
Default Can Excel evaluate one cell and return the information in another?

I am trying to have excel evaluate one cell for a particular month and return
the information found in a seperate cell if it is true. IE.

If B2 = "June", then return the information in A1 (which would be a name
"Thompson"). Also if it does not say "June" then it leaves it blank.

Thompson
Capt I Blue
ER Due June

Thank you
John

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Can Excel evaluate one cell and return the information in another?

One way:

Put this in A1:

=IF(B2="June", "Thompson","")

In article ,
John wrote:

I am trying to have excel evaluate one cell for a particular month and return
the information found in a seperate cell if it is true. IE.

If B2 = "June", then return the information in A1 (which would be a name
"Thompson"). Also if it does not say "June" then it leaves it blank.

Thompson
Capt I Blue
ER Due June

Thank you
John

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Can Excel evaluate one cell and return the information in another?

John,

=IF(B2="June",A1,"")

If by chance B2 contains an Excel date then use:

=IF(MONTH(B2)=6,A1,"")

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"John" wrote in message
...
I am trying to have excel evaluate one cell for a particular month and
return
the information found in a seperate cell if it is true. IE.

If B2 = "June", then return the information in A1 (which would be a name
"Thompson"). Also if it does not say "June" then it leaves it blank.

Thompson
Capt I Blue
ER Due June

Thank you
John



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Can Excel evaluate one cell and return the information in another?

On Mar 24, 6:15 am, "Sandy Mann" wrote:
John,

=IF(B2="June",A1,"")

If by chance B2 contains an Excel date then use:

=IF(MONTH(B2)=6,A1,"")

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk

"John" wrote in message

...



I am trying to have excel evaluate one cell for a particular month and
return
the information found in a seperate cell if it is true. IE.


If B2 = "June", then return the information in A1 (which would be a name
"Thompson"). Also if it does not say "June" then it leaves it blank.


Thompson
Capt I Blue
ER Due June


Thank you
John- Hide quoted text -


- Show quoted text -


What if you have 12 months (Jan-dec) how do you pick the particular
month to show data for that month only?

  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Can Excel evaluate one cell and return the information in another?

On Mar 25, 9:00 am, "Sandy Mann" wrote:
wrote in message

oups.com...

What if you have 12 months (Jan-dec) how do you pick the particular
month to show data for that month only?


I don't understand what you mean. Can you elaborate, In what form is the
Jan - Dec, where is the repated data?

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk

wrote in message

oups.com...



On Mar 24, 6:15 am, "Sandy Mann" wrote:
John,


=IF(B2="June",A1,"")


If by chance B2 contains an Excel date then use:


=IF(MONTH(B2)=6,A1,"")


--
HTH


Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings



with @tiscali.co.uk


"John" wrote in message


...


I am trying to have excel evaluate one cell for a particular month and
return
the information found in a seperate cell if it is true. IE.


If B2 = "June", then return the information in A1 (which would be a
name
"Thompson"). Also if it does not say "June" then it leaves it blank.


Thompson
Capt I Blue
ER Due June


Thank you
John- Hide quoted text -


- Show quoted text -


What if you have 12 months (Jan-dec) how do you pick the particular
month to show data for that month only?- Hide quoted text -


- Show quoted text -


Waht I mean is , I keep track of 4 seperate totals by month for 15
locations Example: Cost of goods, net sales etc.. what I would like is
that when I imput those sepeate spreadsheets, I can choose from a drop
down list the month and then it will give me the info for those
different imputs in one spreadsheet by month..Hope that is clear

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Can Excel evaluate one cell and return the information in another?

wrote in message
oups.com...

Waht I mean is , I keep track of 4 seperate totals by month for 15
locations Example: Cost of goods, net sales etc.. what I would like is
that when I imput those sepeate spreadsheets, I can choose from a drop
down list the month and then it will give me the info for those
different imputs in one spreadsheet by month..Hope that is clear


Do you want formulas with just the totals for a month?
If so assuming that:
1. Headers in all data sheets in Row 1 and Dates in column A
2. You have a consolidation sheet named "Record"
3. In Sheet("Record"):
Cells A1:A12 have a list of January - December
Cell B1 has the formula: =MATCH(C1,A1:A12,0)
Cell C1 has the dropdown referencing the list in A1:A12
(Columns A:B can be hidden if you want)
4. The figures to be added are in Column E

Then try something like:
=SUMPRODUCT((MONTH('Location One'!A2:A366)=B1)*('Location One'!E2:E366))

If you mean you want the all the data for the relevant month in another
sheet then assuming the above set up, I recorded and adapted the following
code which copies all data for the selected month into the "Record" sheet:

Option Explicit
Sub CopyIt()

Dim tSheet As Worksheet
Dim aMonth As Long
Dim rRecordEnd As Long
Dim tEndData As Long
Dim rEndData As Long
Dim rSheetEnd As Long
Dim r As Worksheet

Set r = Sheets("Record")

Application.ScreenUpdating = False

rRecordEnd = r.Cells(r.Rows.Count, 5).End(xlUp).Row
r.Range(r.Cells(1, 5), r.Cells(rRecordEnd, 256)).Clear

For Each tSheet In Worksheets

aMonth = r.Cells(1, 2).Value
rRecordEnd = r.Cells(r.Rows.Count, 5).End(xlUp).Row
If rRecordEnd 1 Then rRecordEnd = rRecordEnd + 2

tSheet.Activate
If tSheet.Name = Sheets("Record").Name Then GoTo skip

tEndData = Cells(Rows.Count, 1).End(xlUp).Row
rEndData = Cells(1, Columns.Count).End(xlToLeft).Column

Columns("A:A").Insert Shift:=xlToRight
Range("A2").FormulaR1C1 = "=MONTH(RC[1])"

Range("A2").AutoFill Destination:= _
Range(Cells(2, 1), Cells(tEndData, 1))

Range("B2").AutoFilter Field:=1, Criteria1:=aMonth
Columns("A:A").EntireColumn.Hidden = True
Cells(Cells(Rows.Count, 2).End(xlUp).Row, 2). _
CurrentRegion.Copy Destination:= _
r.Cells(rRecordEnd, 5)

r.Cells(rRecordEnd, 4).Value = tSheet.Name
Range("A1").AutoFilter
Columns("A:A").Delete Shift:=xlToLeft

Application.Goto reference:=Range("A1"), Scroll:=True
skip:
Next tSheet

r.Select
Application.ScreenUpdating = True
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Can Excel evaluate one cell and return the information in another?

On Mar 26, 4:28 am, "Sandy Mann" wrote:
wrote in message

oups.com...



Waht I mean is , I keep track of 4 seperate totals by month for 15
locations Example: Cost of goods, net sales etc.. what I would like is
that when I imput those sepeate spreadsheets, I can choose from a drop
down list the month and then it will give me the info for those
different imputs in one spreadsheet by month..Hope that is clear


Do you want formulas with just the totals for a month?
If so assuming that:
1. Headers in all data sheets in Row 1 and Dates in column A
2. You have a consolidation sheet named "Record"
3. In Sheet("Record"):
Cells A1:A12 have a list of January - December
Cell B1 has the formula: =MATCH(C1,A1:A12,0)
Cell C1 has the dropdown referencing the list in A1:A12
(Columns A:B can be hidden if you want)
4. The figures to be added are in Column E

Then try something like:
=SUMPRODUCT((MONTH('Location One'!A2:A366)=B1)*('Location One'!E2:E366))

If you mean you want the all the data for the relevant month in another
sheet then assuming the above set up, I recorded and adapted the following
code which copies all data for the selected month into the "Record" sheet:

Option Explicit
Sub CopyIt()

Dim tSheet As Worksheet
Dim aMonth As Long
Dim rRecordEnd As Long
Dim tEndData As Long
Dim rEndData As Long
Dim rSheetEnd As Long
Dim r As Worksheet

Set r = Sheets("Record")

Application.ScreenUpdating = False

rRecordEnd = r.Cells(r.Rows.Count, 5).End(xlUp).Row
r.Range(r.Cells(1, 5), r.Cells(rRecordEnd, 256)).Clear

For Each tSheet In Worksheets

aMonth = r.Cells(1, 2).Value
rRecordEnd = r.Cells(r.Rows.Count, 5).End(xlUp).Row
If rRecordEnd 1 Then rRecordEnd = rRecordEnd + 2

tSheet.Activate
If tSheet.Name = Sheets("Record").Name Then GoTo skip

tEndData = Cells(Rows.Count, 1).End(xlUp).Row
rEndData = Cells(1, Columns.Count).End(xlToLeft).Column

Columns("A:A").Insert Shift:=xlToRight
Range("A2").FormulaR1C1 = "=MONTH(RC[1])"

Range("A2").AutoFill Destination:= _
Range(Cells(2, 1), Cells(tEndData, 1))

Range("B2").AutoFilter Field:=1, Criteria1:=aMonth
Columns("A:A").EntireColumn.Hidden = True
Cells(Cells(Rows.Count, 2).End(xlUp).Row, 2). _
CurrentRegion.Copy Destination:= _
r.Cells(rRecordEnd, 5)

r.Cells(rRecordEnd, 4).Value = tSheet.Name
Range("A1").AutoFilter
Columns("A:A").Delete Shift:=xlToLeft

Application.Goto reference:=Range("A1"), Scroll:=True
skip:
Next tSheet

r.Select
Application.ScreenUpdating = True
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


Sandy,

Thanks, for your effort. The problem is that I am not well versed in
macros. I applied all the info you sent , but it doesn't work. Maybe
you would like to see the worksheet? Then you will know what I would
like...If not, I completely understand, and I thank you so much....

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Can Excel evaluate one cell and return the information in another?

Yes certainly send the sheet if it is not too big. Just replace the part of
my address after the @ sign as it says in my signature.

--

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


wrote in message
oups.com...
On Mar 26, 4:28 am, "Sandy Mann" wrote:
wrote in message

oups.com...



Waht I mean is , I keep track of 4 seperate totals by month for 15
locations Example: Cost of goods, net sales etc.. what I would like is
that when I imput those sepeate spreadsheets, I can choose from a drop
down list the month and then it will give me the info for those
different imputs in one spreadsheet by month..Hope that is clear


Do you want formulas with just the totals for a month?
If so assuming that:
1. Headers in all data sheets in Row 1 and Dates in column A
2. You have a consolidation sheet named "Record"
3. In Sheet("Record"):
Cells A1:A12 have a list of January - December
Cell B1 has the formula: =MATCH(C1,A1:A12,0)
Cell C1 has the dropdown referencing the list in A1:A12
(Columns A:B can be hidden if you want)
4. The figures to be added are in Column E

Then try something like:
=SUMPRODUCT((MONTH('Location One'!A2:A366)=B1)*('Location One'!E2:E366))

If you mean you want the all the data for the relevant month in another
sheet then assuming the above set up, I recorded and adapted the
following
code which copies all data for the selected month into the "Record"
sheet:

Option Explicit
Sub CopyIt()

Dim tSheet As Worksheet
Dim aMonth As Long
Dim rRecordEnd As Long
Dim tEndData As Long
Dim rEndData As Long
Dim rSheetEnd As Long
Dim r As Worksheet

Set r = Sheets("Record")

Application.ScreenUpdating = False

rRecordEnd = r.Cells(r.Rows.Count, 5).End(xlUp).Row
r.Range(r.Cells(1, 5), r.Cells(rRecordEnd, 256)).Clear

For Each tSheet In Worksheets

aMonth = r.Cells(1, 2).Value
rRecordEnd = r.Cells(r.Rows.Count, 5).End(xlUp).Row
If rRecordEnd 1 Then rRecordEnd = rRecordEnd + 2

tSheet.Activate
If tSheet.Name = Sheets("Record").Name Then GoTo skip

tEndData = Cells(Rows.Count, 1).End(xlUp).Row
rEndData = Cells(1, Columns.Count).End(xlToLeft).Column

Columns("A:A").Insert Shift:=xlToRight
Range("A2").FormulaR1C1 = "=MONTH(RC[1])"

Range("A2").AutoFill Destination:= _
Range(Cells(2, 1), Cells(tEndData, 1))

Range("B2").AutoFilter Field:=1, Criteria1:=aMonth
Columns("A:A").EntireColumn.Hidden = True
Cells(Cells(Rows.Count, 2).End(xlUp).Row, 2). _
CurrentRegion.Copy Destination:= _
r.Cells(rRecordEnd, 5)

r.Cells(rRecordEnd, 4).Value = tSheet.Name
Range("A1").AutoFilter
Columns("A:A").Delete Shift:=xlToLeft

Application.Goto reference:=Range("A1"), Scroll:=True
skip:
Next tSheet

r.Select
Application.ScreenUpdating = True
End Sub

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


Sandy,

Thanks, for your effort. The problem is that I am not well versed in
macros. I applied all the info you sent , but it doesn't work. Maybe
you would like to see the worksheet? Then you will know what I would
like...If not, I completely understand, and I thank you so much....



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
Return Side and Header information from table? SteveT Excel Worksheet Functions 4 February 22nd 07 06:17 AM
How do I evaluate a row of cells for a character in each cell? TwoDot Excel Worksheet Functions 2 September 22nd 06 12:53 PM
Function evaluate multiple cells and return 1st one w/a value Dan Shoemaker Excel Discussion (Misc queries) 1 August 27th 06 02:46 AM
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
IF function - need to evaluate cell content in 2 separate files-#N PBM Excel Worksheet Functions 3 July 5th 05 08:17 AM


All times are GMT +1. The time now is 12:22 AM.

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

About Us

"It's about Microsoft Excel"