ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I need to add column based on two conditions using Excel 2003 (https://www.excelbanter.com/excel-programming/426257-i-need-add-column-based-two-conditions-using-excel-2003-a.html)

SW[_2_]

I need to add column based on two conditions using Excel 2003
 
I'm looking to add totals that are associated with a specific date in column
A (say, 1/13); and a students name in column B (say, Harold). Once those two
conditions are met the formula would add the totals of the associated totals
found in column C and place that total in a cell in Column D. I'm using
Excel 2003.

Thanks much for any insight and expertise you may provide.
--
SW

JLGWhiz[_2_]

I need to add column based on two conditions using Excel 2003
 
I expect you will need to post back, because your destination
cell in column D was not specific. This code puts the total
in the next available cell into column D which does not relate
it to its origin. It was also assumed that the values being
totaled contain decimal values, if not, a place is marked for
changing the data type to Long instead of double. It will run
either way and the difference is negligible for this purpose.

Sub stitute()
Dim dt As String, nm As String, lr As Long
Dim ColCval as Double '<<<If no decimals change to Long
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
dt = InputBox("Enter a date to search", "Date")
nm = InputBox("Enter a name to search", "Name")
For Each c In ActiveSheet.Range("A2:A" & lr)
If Not c Is Nothing Then
If c.Value = dt And c.Offset(0, 1).Value _
= rm Then
ColCval = ColCval + ColCval
End If
Next
ActiveSheet.Cells(Rows.Count, 4).End(xlup) = ColCval
End Sub



"SW" wrote in message
...
I'm looking to add totals that are associated with a specific date in
column
A (say, 1/13); and a students name in column B (say, Harold). Once those
two
conditions are met the formula would add the totals of the associated
totals
found in column C and place that total in a cell in Column D. I'm using
Excel 2003.

Thanks much for any insight and expertise you may provide.
--
SW




SW[_2_]

I need to add column based on two conditions using Excel 2003
 
Thanks much for your reply. I think I asked for too much. I was mistaken in
asking for 'programming' help. I'm actually looking for a fomuala that loos
at data in one Work Sheet and transfers the sum to a cell in another work
sheet: all within the same Workbook. I've actually got a working formual
using Excel 2007 but the school I'm working at only has Excel 2003 so I need
to rewrite the formuala.
The following is the Excel 2007 formula I'm using:

SUMIFS('2003 StarWords.xlsx'!GrandTotal,'2003
StarWords.xlsx'!WeekOf,"1/13",'2003 StarWords.xlsx'!Name,"Abby")

I hate to bother you with this but if you can help it would be most
appreciated.

With Much Respect.

Steve
--
SW


"SW" wrote:

I'm looking to add totals that are associated with a specific date in column
A (say, 1/13); and a students name in column B (say, Harold). Once those two
conditions are met the formula would add the totals of the associated totals
found in column C and place that total in a cell in Column D. I'm using
Excel 2003.

Thanks much for any insight and expertise you may provide.
--
SW


JLGWhiz

I need to add column based on two conditions using Excel 2003
 
Why don't you go ahead and post it in the Worksheet functions group. Someone
there who is more familiar with your problem will help you. Just include
your current formula and explain what you want to accomplish. Outside the
file difference in file extensions, I don't know that there is a lot of
difference in the structure of the formula itself.

"SW" wrote:

Thanks much for your reply. I think I asked for too much. I was mistaken in
asking for 'programming' help. I'm actually looking for a fomuala that loos
at data in one Work Sheet and transfers the sum to a cell in another work
sheet: all within the same Workbook. I've actually got a working formual
using Excel 2007 but the school I'm working at only has Excel 2003 so I need
to rewrite the formuala.
The following is the Excel 2007 formula I'm using:

SUMIFS('2003 StarWords.xlsx'!GrandTotal,'2003
StarWords.xlsx'!WeekOf,"1/13",'2003 StarWords.xlsx'!Name,"Abby")

I hate to bother you with this but if you can help it would be most
appreciated.

With Much Respect.

Steve
--
SW


"SW" wrote:

I'm looking to add totals that are associated with a specific date in column
A (say, 1/13); and a students name in column B (say, Harold). Once those two
conditions are met the formula would add the totals of the associated totals
found in column C and place that total in a cell in Column D. I'm using
Excel 2003.

Thanks much for any insight and expertise you may provide.
--
SW


SW[_2_]

Thank you for your direction. Much appreciated.
 

--
SW


"JLGWhiz" wrote:

Why don't you go ahead and post it in the Worksheet functions group. Someone
there who is more familiar with your problem will help you. Just include
your current formula and explain what you want to accomplish. Outside the
file difference in file extensions, I don't know that there is a lot of
difference in the structure of the formula itself.

"SW" wrote:

Thanks much for your reply. I think I asked for too much. I was mistaken in
asking for 'programming' help. I'm actually looking for a fomuala that loos
at data in one Work Sheet and transfers the sum to a cell in another work
sheet: all within the same Workbook. I've actually got a working formual
using Excel 2007 but the school I'm working at only has Excel 2003 so I need
to rewrite the formuala.
The following is the Excel 2007 formula I'm using:

SUMIFS('2003 StarWords.xlsx'!GrandTotal,'2003
StarWords.xlsx'!WeekOf,"1/13",'2003 StarWords.xlsx'!Name,"Abby")

I hate to bother you with this but if you can help it would be most
appreciated.

With Much Respect.

Steve
--
SW


"SW" wrote:

I'm looking to add totals that are associated with a specific date in column
A (say, 1/13); and a students name in column B (say, Harold). Once those two
conditions are met the formula would add the totals of the associated totals
found in column C and place that total in a cell in Column D. I'm using
Excel 2003.

Thanks much for any insight and expertise you may provide.
--
SW



All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com