+ Reply to Thread
Results 1 to 10 of 10

Excel 2007 : If Then Where. Formula across worksheets

  1. #1
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21

    If Then Where. Formula across worksheets

    Hi, first post

    I've been trying to figure this out for awhile which lead me to these forums. Once I get the jist of how this works, it should help me with a great deal more.

    I have a single workbook which contains several worksheets. I have a separate worksheet for formulas which create various totals based on the other worksheets. What I'm trying to do is create a formula like so

    IF the date of cell in column D is equal to the year 2000 (the date format is day/month/year, and the day date is irrelvant in the formula) THEN give me the SUM of column F (but only where column F is in the same row as the column D that meets the required date).

    I understand how to reference to another worksheet to create the formula just not the actually formula required to get the sum of a certain date.

    Basically, I have a worksheet that records expenses over the past 8 years where each row is a purchase and includes data such as the date and amount etc.. so I want to create formulas on a separate worksheet that show the total expenditure for each year.

    Any help appreciated. I will begin to crawl through these forums as they seem to contain a wealth of helpful stuff.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    try
    Please Login or Register  to view this content.
    this would do 2008
    adjust ranges and sheets to suit
    Last edited by martindwilson; 10-26-2008 at 09:44 PM.

  3. #3
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21
    Quote Originally Posted by martindwilson View Post
    try
    Please Login or Register  to view this content.
    this would do 2008
    adjust ranges and sheets to suit
    It gives me a # Error. Only explanation is that wrong type of argument or operand is used.

    Is it trying to SUM the date column to?

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    The error is occurring with Datevalue for me. This should work:
    Please Login or Register  to view this content.
    This is also for 2008.

  5. #5
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284
    One of th eperils of using a non-standard date format

    =SUMPRODUCT(--(D1:D200>=--"2008-01-01"),--(D1:D200<--"2009-01-01"),F1:F200)

  6. #6
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21
    Quote Originally Posted by Bob Phillips View Post
    One of th eperils of using a non-standard date format

    =SUMPRODUCT(--(D1:D200>=--"2008-01-01"),--(D1:D200<--"2009-01-01"),F1:F200)
    Thank you, got it working perfectly with a slight variation of this.

    If I wanted to exclude a specific cell or cells from this formula what would I add?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    exclude what? something in the range D1:D200 ? under what criteria?

  8. #8
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21
    Quote Originally Posted by martindwilson View Post
    exclude what? something in the range D1:D200 ? under what criteria?
    Yes, the former, there's no specific criteria other than the cell itself or cells. So say I wanted to exclude D5, D7 and D101 etc..

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    cant see how to do that short of chnging those cells somehow, add a character or something

  10. #10
    Registered User
    Join Date
    10-26-2008
    Location
    u.K
    Posts
    21
    Thanks anyway. I'll probably attach a keyword and go down that route.

    Going back to my original question, how would I do the exact same formula but instead of basing it on dates, base it on a specific word.

    For example, I wanted it too look at all rows where the column name = "Jon" and then total the equivalent value (currency £). Basically the same as above but using "Jon" instead of a range of dates.

    Also, would I have to format the NAME cell to a specific type, is it better using general or text?

    Many thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1