+ Reply to Thread
Results 1 to 8 of 8

Excel 2007 : Finding the highest value from a cell which is updated daily

  1. #1
    Registered User
    Join Date
    07-16-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Finding the highest value from a cell which is updated daily

    Hi.
    I have an excel doc with 2 sheets. The first sheet is a list of all of my salesmen and the second sheet is a list of the sales made on a particular day (one of the columns is which of the salesmen made the sale). I cut and paste the daily sales into the second sheet every morning.

    What I am trying to do is write a formula to find the date of the most recent sale each of the salesmen have made. In orther words in Sheet1(A2) I would like it to look at Sheet2(A:A) and if the name in Sheet1(A1) is found to take the date, always found in Sheet2(D1) and put that date in Sheet1(A2).

    I have had success with this, but have a huge problem. The way it stands now if a salesman doesn't make a sale in any given day then A2 becomes "False" because the 'If' condition isn't met. What I want to have happen is for it to leave the previous date that was in that cell.

    Not sure if I'm explaining this well.

    Please help.
    Thanks.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Finding the highest value from a cell which is updated daily

    Hi,

    Welcome to the forum, can you post the formula you are using at present?
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    07-16-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Re: Finding the highest value from a cell which is updated daily

    I am currently doing this in 2 steps.
    In the first step I find out how many sales the salesman in question made on the particular day. I use the following formula in Sheet1(C1):


    =COUNTIF(Sheet2!A:A,Sheet1!A1)

    Then I use a formula to grab the date if the result from that is more than 0. I use the following formula in Sheet1(B1):

    =IF(C1>0,Sheet2!D1)

    Where Sheet2!D1 is the date of the sales on Sheet 2.

    There may be a smarter way of doing this.

    I'd appreciate any help.

    Thanks.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Finding the highest value from a cell which is updated daily

    Hi,

    I'm trying to understand the layout, to best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

  5. #5
    Registered User
    Join Date
    07-16-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Re: Finding the highest value from a cell which is updated daily

    OK. Here goes.

    Sheet 1

    A B C
    1 Joe 01/01/09 2
    2 Frank False 0
    3 Tom 01/01/09 4

    Sheet One currently has a list of all of my salesman in column A, I would like to have a formula in each of the column B cells that will update to show the most recent sale made for that particular salesman. Currently I use column C to look in sheet two and find out how many sales an agent made on that particular date, then in column B I have an If function that states that if C>0 then write the new date. However, currently if C<=0 B it returns a Value of False, rather than leaving the date of the most recent sale (which would have been in that cell already, before I cut and paste the new records into Sheet 2).

    The formula that I am currently using in the C column is:
    =COUNTIF(Sheet2!A:A,Sheet1!A1)

    The formula that I am currently using in the B column is:
    =IF(C1>0,Sheet2!D1)




    Sheet 2

    A B C
    1 01/01/09
    2
    3 Joe
    4 Tom
    5 Tom
    6 Tom
    7 Joe
    8 Tom

    Sheet 2 is updated daily. Each day I cut and paste the daily sales results into Sheet 2. B1 is always the date for the current results and column A is the list of who made each sale on that particular day.


    Thanks.

  6. #6
    Registered User
    Join Date
    07-16-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    11

    Unhappy Re: Finding the highest value from a cell which is updated daily

    Sorry, I don't know how to post so the table looks correct, this one looks better

    Sheet 1
    ···············A···············B················C
    1············Joe·········01/01/09··········2
    2···········Frank··········False·············0
    3···········Tom·········01/01/09··········4


    Sheet 2
    ···············A···············B················C
    1·························01/01/09·············
    2··················································
    3············Joe··································
    4············Tom·································
    5············Tom·································
    6············Tom·································
    7············Joe··································
    8············Tom·································

    Thanks...

  7. #7
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Finding the highest value from a cell which is updated daily

    Hi,

    To remove the FALSE when there isn't any sales you could modify your formula to

    =IF(C1>0,Sheet2!$D$1,"") this will leave a blank against that person if he didn't make any sales. If you want it to retain the previous date when he did get sales then the only way is with VBA, but I'm afraid that not my expertise. If no one picks this up to help, I would post another question in the Programming forum, you could copy the link to this post in your question so I'll include a workbook for you.

    Good luck
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-16-2009
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    11

    Smile Re: Finding the highest value from a cell which is updated daily

    Yes, I guess I will need to try and figure out how to do it using VBA. I will re-post where you suggested.

    Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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