+ Reply to Thread
Results 1 to 11 of 11

Multiply based on dropdown list conditions.

  1. #1
    Registered User
    Join Date
    12-06-2023
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    94

    Multiply based on dropdown list conditions.

    Hi there,

    I am trying to fine tune a labour/crop work tracker. This is what I am trying to accomplish.

    1) I would like to have the total labour hours per team member displayed in Q11.
    2) I would like to be able to choose a letter from I11's dropdown list, and it selects the appropriate Target Event based on the letter.
    3) Now each target event has a different amount of hours located in Column C.
    4) Finally I would like the total labour hours from column C multiplied by the # of People in P11 and displayed in Q11.

    I need help with the dropdown list part, I need the formula to be able to know where to look.

    Here is the file Crop Logs - Template.xlsx

    Thanks in advanced.
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,525

    Re: Multiply based on dropdown list conditions.

    I think this is what you are looking for...
    in I11 (dragged up and down) =VLOOKUP(J11,$A$3:$B$9,2,FALSE)
    in Q11 (also dragged up and down) =P11*VLOOKUP(J11,$A$3:$C$9,3,FALSE)
    other formulas such as index/match and xlookup would also work.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    12-06-2023
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    94

    Re: Multiply based on dropdown list conditions.

    This works perfectly, thank you Sam.

  4. #4
    Registered User
    Join Date
    12-06-2023
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    94

    Re: Multiply based on dropdown list conditions.

    Hi Sam,

    I have just been asked to add a few more things to this file, I am hoping you can help. I have already gone ahead and added the Data to the data sheet.

    I would like the harvest date range to populate cell N2 based on the Cultivar chosen. It needs to be in this format (01-Jan-2024 - 04-Jan-2024). The harvest info is on the "Data" sheet in cells AD3 to AG24.

    Here is the file in question: --NEW-- Crop Logs - Template.xlsx

    Thank you in advance!!
    Last edited by Tricks420; 05-21-2024 at 04:56 PM.

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,525

    Re: Multiply based on dropdown list conditions.

    Ok, this appears to work in N2...
    =TEXT(H1+XLOOKUP($H$2,Data!$A$3:$A$24,Data!$AD$3:$AD$24,,0,),"dd-mmm-yyyy")&" - "&IF(TEXT(H1+XLOOKUP($H$2,Data!$A$3:$A$24,Data!$AG$3:$AG$24,,0,),"dd-mmm-yyyy")=TEXT(H1,"dd-mmm-yyyy"),TEXT(H1+XLOOKUP(H2,Data!$A$3:$A$24,Data!$AF$3:$AF$24,,0,),"dd-mmm-yyyy"),TEXT(H1+XLOOKUP($H$2,Data!$A$3:$A$24,Data!$AG$3:$AG$24,,0,),"dd-mmm-yyyy"))
    now, looking at the data tab I see that you have one "cultivar" that has a value for harvest day in column AH that wasn't included in your post #4, what do you want to do about that? Right now my formula ignores that.

  6. #6
    Registered User
    Join Date
    12-06-2023
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    94

    Re: Multiply based on dropdown list conditions.

    It does appear to work! You are a genius thank you very much. Wow. I am attempting to decipher that formula, it's probably the most complicated I have ever seen.

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,525

    Re: Multiply based on dropdown list conditions.

    you're welcome! and thanks for the rep!
    it really isn't that complicated, it is just using the date in H1 and adding it to the numbers that are in AD3 through AG24 found using an XLOOKUP based on your dropdown in H2 and then when it finds the value in those columns and rows (AD3 through AG24) it adds the value to the date in H1 which will only come up as a number ... hence the text formatting with the way you want it using dd-mmm-yyyy and this part & - & combines it with the other value it finds to give you the date range you are looking for... 15-Jul-2024 - 18-Jul-2024
    this part...
    =TEXT(H1+XLOOKUP($H$2,Data!$A$3:$A$24,Data!$AD$3:$AD$24,,0,),"dd-mmm-yyyy")&" - "&IF(TEXT(H1+XLOOKUP($H$2,Data!$A$3:$A$24,Data!$AG$3:$AG$24,,0,),"dd-mmm-yyyy")=TEXT(H1,"dd-mmm-yyyy") is looking for what you want in AD through AG, and if it returns what is in H1 (text wise because H1 is only formatted to look like you want) it then goes to AF to look for the value using this...
    TEXT(H1+XLOOKUP(H2,Data!$A$3:$A$24,Data!$AF$3:$AF$24,,0,),"dd-mmm-yyyy")
    otherwise it returns what is in AG with this final part of the if statement... TEXT(H1+XLOOKUP($H$2,Data!$A$3:$A$24,Data!$AG$3:$AG$24,,0,),"dd-mmm-yyyy"))

    what took me so long was getting the syntax/sequence of the true and false parts of the if statement to return the correct values.

  8. #8
    Registered User
    Join Date
    12-06-2023
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    94

    Re: Multiply based on dropdown list conditions.

    Hey Sam,

    Thanks again for all your help, you have been a great assistance.

    I think this is my last question and the form is done... hopefully.

    I am trying to do the following:

    1) First I would input the Cultivar in H2, the plug date in N1, and then finally the number of tables in P1.
    2) Then I would select an event in Column K.
    3) Next I would be entering the amount of people inColumn Q.
    4)I would like it to then calculate the amount of "Target Hours" in Column S. To do this you would need to take the amount tables in Column R multiplied by the appropriate hours in Column C.

    Error

    A) I also have a #SPILL! error in C3

    Here is the file: --NEW-- Crop Logs - Template.xlsx

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,112

    Re: Multiply based on dropdown list conditions.

    To get around the #SPILL! error:

    =TAKE(TOCOL(P1*0.5/Q5:Q84,3),1)

    Otherwise, this thread is marked as solved and the new requirements are different - please start a NEW thread for the 'last' question. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    Registered User
    Join Date
    12-06-2023
    Location
    Ontario
    MS-Off Ver
    365
    Posts
    94

    Re: Multiply based on dropdown list conditions.

    Than you Ali, appears to work perfectly.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,112

    Re: Multiply based on dropdown list conditions.

    Great stuff!

+ 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. Replies: 6
    Last Post: 01-20-2024, 08:32 PM
  2. [SOLVED] Macro for a dropdown list with conditions.
    By daithy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2022, 06:24 PM
  3. [SOLVED] Multiply one textbox by different textboxes based on conditions
    By leea0109 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2021, 08:30 AM
  4. Adding conditions to dropdown list
    By Catherine Cheung in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-02-2021, 09:06 AM
  5. Dropdown list with multiple conditions...
    By skadieverwinter in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-24-2013, 09:33 PM
  6. Cull dropdown list options based on selection in another dropdown
    By Kiffar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2012, 01:53 AM
  7. Replies: 1
    Last Post: 07-06-2011, 10:53 AM

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