Do I need SUMIFS, VLOOKUP or both or neither? :/

paulpitchford

New Member
Joined
Sep 13, 2010
Messages
12
Hi,

As you can probably tell from the title, I don't know how to do what I want to do. I know a few good formulae but can't seem to bring them together to do what I'd like. To start with I have this table:


Excel Workbook
ABCDEFGHI
1DateWeekWeight lbsTarget WeightWieght LossBMIMiles CycledMiles RanCalories Burned
220/05/20110254254038.620.000.000
324/05/20111254252.4038.62***
401/06/20112*250.800.00***
508/06/20113*249.200.00***
615/06/20114*247.600.00***
722/06/20115*24600.00***
829/06/20116*244.400.00***
906/07/20117*242.800.00***
Weight


Then on another sheet I have this:

Excel Workbook
ABCDEFG
1DateActivityDistanceTimesCaloriesRouteNotes
224/05/2011Cycling11.2301:13:00841Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
325/05/2011Cycling12.2302:13:00842Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
426/05/2011Cycling13.2303:13:00843Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
527/05/2011Cycling14.2304:13:00844Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
628/05/2011Cycling15.2305:13:00845Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
729/05/2011Cycling16.2306:13:00846Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
830/05/2011Cycling17.2307:13:00847Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
931/05/2011Cycling18.2308:13:00848Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
Fitness


What I'd like to do is on the weight sheet, I'd like to calculate how many miles I've cycled during that week. On the fitness sheet, please ignore the values as I made them up for relevance for this post. The other activity could be running so I would like to differentiate between to two activities as you can see from the Weight sheet.

I hope this makes sense and thanks for the help in advance.

Paul.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
To elaborate on this..

This totals all of the cycling distances up regardless of which week it was:

=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling")

Ideally, into cells G3 through 29 I'd then like to break this down into the week (e.g. 24/05 - 30/05).

I thought the above would work with by attaching some sort of VLOOKUP. However, no matter what I try I get an error.

Any advice?
 
Upvote 0
If this
=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling")

works, and you just want to break it down between 2 dates...

Try

=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling",Fitness!A:A,">=24/05/2011",Fitness!A:A,"<=30/05/2011")
 
Upvote 0
I've done it. I've added the week column to the Fitness form using a VLOOKUP:


Excel Workbook
ABCDEFGH
1DateWeekActivityDistanceTimesCaloriesRouteNotes
224/05/20111Cycling11.2301:13:00841Mansfield, Ches Rd, Back of Reindeer, HomeApprox Calories
Fitness


I've then used this formula to add the weeks up:

=SUMIFS(Fitness!D:D,Fitness!C:C,"Cycling", Fitness!B:B,Weight!B3)

If anyone can think of a more efficient way to do this, please feel free to let me know.

Thanks,

Paul.
 
Upvote 0
If this
=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling")

works, and you just want to break it down between 2 dates...

Try

=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling",Fitness!A:A,">=24/05/2011",Fitness!A:A,"<=30/05/2011")

Hi, thanks for the reply. Sorry I missed it. As it happens, I'd tried this myself and it returns 0. I was a bit surprised that it didn't work.

Paul.
 
Upvote 0
I would then guess that your dates in column A are not really dates.
They are just text strings that look like dates...

What does this return

=ISNUMBER(Fitness!A2)
And filled down.

Are they All true or false, or a mixture?
 
Upvote 0
Is your system actually set to use UK dates, or are you using US dates, and those date cells are just formatted to show dd/mm/yyyy?

Does this work?
=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling",Fitness!A:A,">=05/24/2011",Fitness!A:A,"<=05/30/2011")
Notice the reversal of the date formats.
 
Upvote 0
Strange, it works for me.

Even with the reversed Date format, it does not error.
It returns 0, but not an error.

Excel 2007<TABLE style="BORDER-RIGHT: #a6aab6 1px solid; BORDER-TOP: #a6aab6 1px solid; BORDER-LEFT: #a6aab6 1px solid; BORDER-BOTTOM: #a6aab6 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff" cellPadding=2 rules=all><COLGROUP><COL style="BACKGROUND-COLOR: #e0e0f0" width=25><COL><COL><COL><COL></COLGROUP><THEAD><TR style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0; TEXT-ALIGN: center"><TH></TH><TH>A</TH><TH>B</TH><TH>C</TH><TH>D</TH></TR></THEAD><TBODY><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">1</TD><TD style="TEXT-ALIGN: right">21/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">49</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">22/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">2</TD><TD style="TEXT-ALIGN: right">0</TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">23/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">3</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">24/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">4</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">25/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">5</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">26/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">6</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">7</TD><TD style="TEXT-ALIGN: right">27/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">7</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">8</TD><TD style="TEXT-ALIGN: right">28/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">8</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">9</TD><TD style="TEXT-ALIGN: right">29/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">9</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">10</TD><TD style="TEXT-ALIGN: right">30/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">10</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">11</TD><TD style="TEXT-ALIGN: right">31/05/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">11</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">12</TD><TD style="TEXT-ALIGN: right">01/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">12</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">13</TD><TD style="TEXT-ALIGN: right">02/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">13</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">14</TD><TD style="TEXT-ALIGN: right">03/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">14</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">15</TD><TD style="TEXT-ALIGN: right">04/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">15</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">16</TD><TD style="TEXT-ALIGN: right">05/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">16</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">17</TD><TD style="TEXT-ALIGN: right">06/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">17</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">18</TD><TD style="TEXT-ALIGN: right">07/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">18</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">19</TD><TD style="TEXT-ALIGN: right">08/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">19</TD><TD style="TEXT-ALIGN: right"></TD></TR><TR><TD style="COLOR: #161120; TEXT-ALIGN: center">20</TD><TD style="TEXT-ALIGN: right">09/06/2011</TD><TD>Cycling</TD><TD style="TEXT-ALIGN: right">20</TD><TD style="TEXT-ALIGN: right"></TD></TR></TBODY></TABLE>
Fitness


<TABLE style="BORDER-RIGHT: black 2px solid; PADDING-RIGHT: 0.4em; BORDER-TOP: black 2px solid; PADDING-LEFT: 0.4em; PADDING-BOTTOM: 0.4em; BORDER-LEFT: black 2px solid; PADDING-TOP: 0.4em; BORDER-BOTTOM: black 2px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff" cellPadding=2 rules=all width="85%"><TBODY><TR><TD style="PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px">Worksheet Formulas<TABLE style="BORDER-RIGHT: #a6aab6 1px solid; BORDER-TOP: #a6aab6 1px solid; BORDER-LEFT: #a6aab6 1px solid; BORDER-BOTTOM: #a6aab6 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center" cellPadding=2 rules=all width="100%"><THEAD><TR style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0"><TH width=10>Cell</TH><TH style="PADDING-LEFT: 5px; TEXT-ALIGN: left">Formula</TH></TR></THEAD><TBODY><TR><TH style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0" width=10>D1</TH><TD style="TEXT-ALIGN: left">=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling",Fitness!A:A,">=24/05/2011",Fitness!A:A,"<=30/05/2011")</TD></TR><TR><TH style="COLOR: #161120; BACKGROUND-COLOR: #e0e0f0" width=10>D2</TH><TD style="TEXT-ALIGN: left">=SUMIFS(Fitness!C:C,Fitness!B:B,"Cycling",Fitness!A:A,">=05/24/2011",Fitness!A:A,"<=05/30/2011")</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,548
Members
452,927
Latest member
rows and columns

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top