Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Simple yet I can't quite get it right

I have a sheet setup to record my gas usage. The sheet is setup like so:

Week | gallons | price | vehicle | gallons | price | vehicle | and so on.
1 3.23 $3.50 Bike 3.45 $3.89 stang .......
2 3.23 $3.50 Bike 3.45 $3.89 bike .......
3 3.23 $3.50 stang 3.45 $3.89 bike .......


I want to look take all of the information at the end of the week and find
out how much i spent on my car and how much i spent on my bike. I want to
have a column on the right side of my sheet that will reference only the
cells that are labled bike and add them up and put the total amount of money
I spent in gas for my bike in that week. and the same for my mustang.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Simple yet I can't quite get it right

You have made life very difficult for yourselg. HAd the data been set out as
bewlo, a simple filter or Listt would work
Week | gallons | price | vehicle
1 \ 3.23 \ $3.50 \ Bike
1 \ 3.45 \ $3.89 \ stang
.....
Are you prepared fro a VBA solution to the orginal data?
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme




"ScottBraunDesign" wrote in
message ...
I have a sheet setup to record my gas usage. The sheet is setup like so:

Week | gallons | price | vehicle | gallons | price | vehicle | and so on.
1 3.23 $3.50 Bike 3.45 $3.89 stang
.......
2 3.23 $3.50 Bike 3.45 $3.89 bike
.......
3 3.23 $3.50 stang 3.45 $3.89 bike
.......


I want to look take all of the information at the end of the week and find
out how much i spent on my car and how much i spent on my bike. I want to
have a column on the right side of my sheet that will reference only the
cells that are labled bike and add them up and put the total amount of
money
I spent in gas for my bike in that week. and the same for my mustang.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Simple yet I can't quite get it right

=SUMPRODUCT(--($D2:G2="Bike"),$B2:E2,$C2:F2)

Just change the G2,E2,F2 to the last possible cells that you use, BUT NOTE
the offsets and maintain that.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"ScottBraunDesign" wrote in
message ...
I have a sheet setup to record my gas usage. The sheet is setup like so:

Week | gallons | price | vehicle | gallons | price | vehicle | and so on.
1 3.23 $3.50 Bike 3.45 $3.89 stang
.......
2 3.23 $3.50 Bike 3.45 $3.89 bike
.......
3 3.23 $3.50 stang 3.45 $3.89 bike
.......


I want to look take all of the information at the end of the week and find
out how much i spent on my car and how much i spent on my bike. I want to
have a column on the right side of my sheet that will reference only the
cells that are labled bike and add them up and put the total amount of
money
I spent in gas for my bike in that week. and the same for my mustang.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 271
Default Simple yet I can't quite get it right

i am still learning about exct - but wouldn't a pivot table work? if not, why?

"ScottBraunDesign" wrote:

I have a sheet setup to record my gas usage. The sheet is setup like so:

Week | gallons | price | vehicle | gallons | price | vehicle | and so on.
1 3.23 $3.50 Bike 3.45 $3.89 stang .......
2 3.23 $3.50 Bike 3.45 $3.89 bike .......
3 3.23 $3.50 stang 3.45 $3.89 bike .......


I want to look take all of the information at the end of the week and find
out how much i spent on my car and how much i spent on my bike. I want to
have a column on the right side of my sheet that will reference only the
cells that are labled bike and add them up and put the total amount of money
I spent in gas for my bike in that week. and the same for my mustang.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 109
Default Simple yet I can't quite get it right

Susan

If Scott had set up his data the way Bernard just recommended, a pivot
table would work fine. As it is, with repeated column headings and
the same type of data (e.g. priece, vehicles, etc.) in multiple
columns he won't be able to get his data with a pivot table or a
filter. It may as well have been typed into a work document, almost.
Bob's sumproduct formula could save him, but, he should probably
rearrange the data so he use some of the advantages that a spreadsheet
provides.

Ken


On May 22, 3:55*pm, susan wrote:
i am still learning about exct - but wouldn't a pivot table work? *if not, why?



"ScottBraunDesign" wrote:
I have a sheet setup to record my gas usage. The sheet is setup like so:


Week | gallons | price | vehicle | gallons | price | vehicle | and so on..
* *1 * * * * *3.23 * *$3.50 * *Bike * * * *3.45 * * $3.89 * * stang * .......
* *2 * * * * *3.23 * *$3.50 * *Bike * * * *3.45 * * $3.89 * * bike * * .......
* *3 * * * * *3.23 * *$3.50 * *stang * * *3.45 * * $3.89 * * bike * * .......


I want to look take all of the information at the end of the week and find
out how much i spent on my car and how much i spent on my bike. I want to
have a column on the right side of my sheet that will reference only the
cells that are labled bike and add them up and put the total amount of money
I spent in gas for my bike in that week. and the same for my mustang.- Hide quoted text -


- Show quoted text -




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
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple lookup - or maybe not so simple - help! ChrisHodds Excel Worksheet Functions 1 September 27th 06 03:09 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM


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