+ Reply to Thread
Results 1 to 17 of 17

Need help creating a formula

  1. #1
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Thumbs up Need help creating a formula

    Screen Shot 2017-09-21 at 10.47.56.png


    Hi I need help,

    I need the Sample.ID to correspond to date.

    i.e, Date - 2009 = PACE01-612
    Date - 2011 = PACE02-612
    Date - 2012 = PACE03-612

    The spreadsheet is much bigger than screenshot, I have been trying to do this manually,but I'm sure there is a formula I can use to help.

    I would appreciate your help

    Thanks,
    Jordan

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need help creating a formula

    Hello and welcome to the forum.

    A sample worksheet will help us much more than a screenshot.

    That being said, assuming that your dates are in column C starting in C2, try this in B2

    =LOOKUP(YEAR(C2),{2009,2011,2012},{"PACE01-612","PACE02-612","PACE03-612"})

  3. #3
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Thumbs up Re: Need help creating a formula

    Thank you for your reply.

    Attachment 539245

    Here is a a better screenshot of the table.

    I need the very first year for each individual Study ID to be 'PACE01-...'

    For example row 30; Study 454 has 2010 as it's first year so it has to be 'PACE01-454'. Whereas row 3; Study 192 has 2009 as it's first year so it also needs to 'PACE01-192'.


    Hope this makes sense.

    Thanks again.
    Last edited by Jbrowne13; 09-21-2017 at 03:33 PM. Reason: Wrong Image

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need help creating a formula

    You are changing the requirements.

    To prevent us from going back and fourth until you find a solution that you like, please upload a small representative sample of your workbook along with the desired results (manually entered) of a formula.

    This will help us get to a solution faster than looking at screenshots.

  5. #5
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Re: Need help creating a formula

    https://www.excelforum.com/attachmen...7&d=1506015684

    I dont know if that link will work. I uploaded an attachment. I cant get it attached to this thread though.

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need help creating a formula

    No, that link did not work.

    To upload a workbook, click on Go Advanced > Manage Attachments > Choose File > Upload > Close this window.

  7. #7
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Re: Need help creating a formula

    I have followed these instruction and have attached 'Workbook 1'
    Attached Files Attached Files

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need help creating a formula

    I cannot seem to find any correlation between your desired outcome and the other data in your sample.

    There are some instances where the Sample.ID matches the Desired Outcome exactly and other instances where the Desired Outcome is increasing by 1.

    Maybe I am missing something. I am tapping out. Hopefully someone else will be able to assist you.

  9. #9
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Re: Need help creating a formula

    The Study ID have have up to 3 different collection years (hence PACE01-..., PACE02-... and PACE03-...)

    For the very first collection year it has to PACE01 and then increase by 1 for each later year.


    Hope this makes sense, sorry if I didnt make it compleetly clear.

    I have PACE01 for them all at present which does match the 1st Year collection but nothing else

    Thanks,
    Jordan

  10. #10
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Re: Need help creating a formula

    Here is an updated workbook, hopefully this makes things clearer
    Attached Files Attached Files

  11. #11
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help creating a formula

    Maybe PivotTable ?
    If not, add example EXCEL FILE (Before and After sheets), (NOT A PICTURE!!!) with what you want to achieve (10... 20 rows)

    btw. I'm tired of scrolling through the screen with your monster, unnecessary pictures
    Last edited by sandy666; 09-21-2017 at 03:37 PM.

  12. #12
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Re: Need help creating a formula

    Hi sandy666,

    I have removed screenshots now. I have added an example excel spreadsheet with what I want to achieve. I want the PACE01, PACE02, PACE03, PACE04 to respectively match the first sample date right up to the last and for the Study.ID to be incorporated as well.

    Thanks for your help.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-21-2017
    Location
    Toronto
    MS-Off Ver
    Version 15.33
    Posts
    8

    Re: Need help creating a formula

    I need the order of unique aliquot id's to remain the same as I am loading this into a biorepository database.

  14. #14
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help creating a formula

    What is (should be) the pattern between Study.ID and PACE.... ? last 2-3 digits? or something more?

  15. #15
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Need help creating a formula

    Quote Originally Posted by Jbrowne13 View Post
    I need the order of unique aliquot id's to remain the same as I am loading this into a biorepository database.
    • don't touch unique aliquot id's column (frozen?)
    • sort/transform/whatever columns: PACE and Study.ID by date

    I think I don't understand this conception and logic , sorry
    Last edited by sandy666; 09-21-2017 at 05:01 PM.

  16. #16
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Need help creating a formula

    Your expected results look inconsistent to me in D11:D13 - I think they should all be PACE03. Assuming I've got that right and I'm understanding the objective clearly, try array-entering (confirm with Ctrl + Shift + Enter instead of Enter) the following in D2:

    ="PACE"&TEXT(SUMPRODUCT(($E$2:$E$21<=E2)*($C$2:$C$21=C2)*(1/COUNTIFS($E$2:$E$21,$E$2:$E$21))),"00")&"-"&C2

    Take a look at the attachment to see if I've got it right. I left your expectations in column D (with the typo in D11 and D12?) and put the formula in H2:
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  17. #17
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Need help creating a formula

    Hello Jbrowne13 & Welcome to the Forum,

    Administrative Note:
    • We would love to continue to help you with your query, but first, before we can proceed…
    • Please see Forum Rule #1 about proper thread titles and adjust accordingly...

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    HTH
    Regards, Jeff

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Use an existing cell formula for creating a new more complex formula
    By dubcap01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 07:41 AM
  2. Replies: 1
    Last Post: 11-21-2012, 02:03 AM
  3. VBA:Creating Formula
    By dianahatesboys in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2006, 06:00 PM
  4. [SOLVED] Creating formula
    By Lara Leigh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2006, 09:30 PM
  5. Help with creating a formula...
    By Meleah Mae in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-11-2006, 01:40 PM
  6. creating a formula
    By wwoody in forum Excel General
    Replies: 3
    Last Post: 01-11-2006, 03:14 AM
  7. [SOLVED] need help creating a formula
    By Matt in forum Excel General
    Replies: 1
    Last Post: 10-12-2005, 01:05 PM

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