+ Reply to Thread
Results 1 to 4 of 4

Taking the value of one cell based on the information on an adjacent cell.

Hybrid View

  1. #1
    Registered User
    Join Date
    11-28-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    4

    Taking the value of one cell based on the information on an adjacent cell.

    Hi Guys,

    Im a complete new member and at best I am mediocre so I assume I will be bothering you quite abit! I need a formulae that will effectivley the value of cells that fall within certain dates.

    eg.. if the dates in colum F are between 1/1/2010 and the 31/12/2010 then add up the data in colum D that are next to these dates.

    I have attached a sheet that I hopes makes this more clear.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Taking the value of one cell based on the information on an adjacent cell.

    A few approaches in truth.

    =SUMPRODUCT((TEXT(F2:F64,"yyyy")="2010")+0,D2:D64)
    or if you know F2:F64 will always and only contain numbers (dates) [not the case here] then

    =SUMPRODUCT((YEAR(F2:F64)=2010)+0,D2:D64)
    or if you will not always be looking for a given year but variable dates (eg Jan-Jun) then:

    =SUMPRODUCT((F2:F64>=DATE(2010,1,1))*(F2:F64<=DATE(2010,6,30)),D2:D64)
    SUMPRODUCT is not overly efficient so you could also consider using 2 SUMIFs (or SUMIFS XL2007+)

    =SUM(SUMIF(F2:F64,{">=01/01/2010",">=01/01/2011"},D2:D64)*{1,-1})
    Finally... and not least... you might want to consider using a Pivot Table if the analysis is based on years etc (you can group the Date Field by Year) but again this would require only numbers in column F (not presently the case)

  3. #3
    Registered User
    Join Date
    11-28-2010
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Taking the value of one cell based on the information on an adjacent cell.

    Your an absolute lad! Cheers
    Last edited by DonkeyOte; 11-29-2010 at 07:40 AM. Reason: removed unnecessary quote

  4. #4
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Taking the value of one cell based on the information on an adjacent cell.

    Select the required cell for example I19
    enter the formula

    =IF(AND(F19>=DATE(2010,1,1),F19<=DATE(2010,12,31)),D20+D21+D22,"---")

    If value in F2 is between 01/01/2010 and 12/31/2010 it will add next three values in column D other wise write "----" there
    copy this formula to all the column

    You have to change the formula for every year

+ 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