+ Reply to Thread
Results 1 to 35 of 35

Formula to alter calculation dependant on drop down list value

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Formula to alter calculation dependant on drop down list value

    Hi,
    This is a continuation of a previous question that we sorted....

    I have a spreadsheet that users fill in, they should use a comma to separate the different values that they might enter into a cell but they don't always, also they don't always use a Capital letter at the start of their code, hence some of the specifics we have had to create in the formula as it stands.

    I can't alter the data collection section of the sheet but can add more sheets, reposition the reporting etc.

    What I would like is the ability to pick a day and time from the drop down lists in the report section and have that alter the relevant results in the report section.
    My gut says that some sort of lookup table would help but i can't figure it out. Can anyone help?

    Data 2.jpg
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Thoughts on this:

    Have the data in a single table i.e Monday C5:H18, Tuesday C 19:H32 etc

    Create a "working" table so that data for a given day is "copied" to this table based on the day selected.

    Base your formulae on this table

  3. #3
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Sounds like a good plan - or at least the start of one.

    I have created a sheet with the data copied over as you suggested. Now how would you suggest for me to alter the formula so it knows when to look at the relevant section of that table based on the drop down selections?

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    See attached in sheet "EXAMPLE"

    In L5

    =INDEX($C$3:$H$82,MATCH($K$1,$B$3:$B$82,0)+ROWS($1:2),COLUMNS($A:A))

    copy across and down

    this is your workarea based on data in B3:H82

    The cells in the WORKAREA are formatted to hide zeros

    in S5

    =SUBSTITUTE(SUBSTITUTE(L5 & ","&M5& ","&N5& ","&O5& ","&P5& ","&Q5,"0",""),",","")

    hides zeros and commas

    How will you handle each week as you ideally only want a single workarea?

    I have added your Dashboard into "Example" with dynamic lookups.

    e.g O30

    =(LEN(UPPER(INDEX($L$5:$Q$18,$M$30-5,ROWS($1:1))))-LEN(SUBSTITUTE(UPPER(INDEX($L$5:$Q$18,$M$30-5,ROWS($1:1))),$O$25,"")))/2

    In C5 "Example"

    =INDEX(INDIRECT("'"&$K$1&"'!$C$5:$H$18"),ROWS($1:1),COLUMNS($A:A))

    copies data from Week selected in K1 for Monday
    Attached Files Attached Files
    Last edited by JohnTopley; 02-24-2021 at 04:08 PM.

  5. #5
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    This looks amazing thank you.

    Might need to do a little tweaking but its really close to what i'm after.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    one "tweak" is to remove the headings in the combined table for days Tuesday to Friday so you have contiguous data for a week. Put the day in the leftmost column (at least on the 6 hour line).

    You will need to amend a formula or two but nothing major.

    Re WEEKS: a sheet per week or all weels on one sheete; down columns - approximately 3000 rows - OR across columns - approximately 350 columns.

    One (not major) advantage is that it removes the need for the INDIRECT used in the formula to "grab" the data fron a WEEK sheet to the "Workarea" sheet.

    Whatever you do, avoid having data in "blocks" as per your original format . Simply columns (Fields) and rows (Records) format is the "gold" standard.

  7. #7
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    You've done an amazing job with this thank you.
    Looking through your formulas is definitely increasing my own knowledge.
    Unfortunately the original format was something that was already 'in the wild' and i just needed to do this to be able to work with it. If they were looking to repeat i would completely alter the way it was set up.

    One last calculation you might (almost definitely will) be able to help with. How could i count all the instances of any code (not just a specific one) within the 'Work Area' given that whole issue of them not always having a comma or being in the right case?

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Can you post an example of your last request: I noted there are many codes ... not just the Cn ones so I want to make sure I cover all bases. Include lower and upper cases and missing commas please..

    Re the formatting: if the input is in "Blocks" then you just need a formula per day to tranfser into the columnar format in "Example"

    First, try

    is "Example"

    S5

    =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(L5 & ","&M5& ","&N5& ","&O5& ","&P5& ","&Q5,"0",""),",","")," ","")

    copy down

    in U5

    =LEN($S5)/2

    in U19

    =SUM($U5:$U18)
    Last edited by JohnTopley; 02-25-2021 at 06:38 AM.

  9. #9
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Certainly.
    So I've added a box out (in Red) which shows how many of all codes were entered that day. The formula should come back with, in this instance, the answer 27.

    I tried a variation of the earlier formula but obviously it needs a reference to be able to count. I tried both "*" as a wild card and also pointing it to the lookup table of all the codes but neither seemed to work.

    I (probably wrongly) assumed a variation of this code would work but i just can't work out what to swap the O25 reference for so it looks for all codes and not just the one in O25

    =(LEN(UPPER(L5)&","&UPPER(M5)&","&UPPER(N5)&","&UPPER(O5)&","&UPPER(P5)&","&UPPER(Q5)&","&UPPER(L6)&","&UPPER(M6)&","&UPPER(N6)&","&UPPER(O6)&","&UPPER(P6)&","&UPPER(Q6)&","&UPPER(L7)&","&UPPER(M7)&","&UPPER(N7)&","&UPPER(O7)&","&UPPER(P7)&","&UPPER(Q7)&","&UPPER(L8)&","&UPPER(M8)&","&UPPER(N8)&","&UPPER(O8)&","&UPPER(P8)&","&UPPER(Q8)&","&UPPER(L9)&","&UPPER(M9)&","&UPPER(N9)&","&UPPER(O9)&","&UPPER(P9)&","&UPPER(Q9)&","&UPPER(L10)&","&UPPER(M10)&","&UPPER(N10)&","&UPPER(O10)&","&UPPER(P10)&","&UPPER(Q10)&","&UPPER(L11)&","&UPPER(M11)&","&UPPER(N11)&","&UPPER(O11)&","&UPPER(P11)&","&UPPER(Q11)&","&UPPER(L12)&","&UPPER(M12)&","&UPPER(N12)&","&UPPER(O12)&","&UPPER(P12)&","&UPPER(Q12)&","&UPPER(L13)&","&UPPER(M13)&","&UPPER(N13)&","&UPPER(O13)&","&UPPER(P13)&","&UPPER(Q13)&","&UPPER(L14)&","&UPPER(M14)&","&UPPER(N14)&","&UPPER(O14)&","&UPPER(P14)&","&UPPER(Q14)&","&UPPER(L15)&","&UPPER(M15)&","&UPPER(N15)&","&UPPER(O15)&","&UPPER(P15)&","&UPPER(Q15)&","&UPPER(L16)&","&UPPER(M16)&","&UPPER(N16)&","&UPPER(O16)&","&UPPER(P16)&","&UPPER(Q16)&","&UPPER(L17)&","&UPPER(M17)&","&UPPER(N17)&","&UPPER(O17)&","&UPPER(P17)&","&UPPER(Q17)&","&UPPER(L18)&","&UPPER(M18)&","&UPPER(N18)&","&UPPER(O18)&","&UPPER(P18)&","&UPPER(Q18))-LEN(SUBSTITUTE(UPPER(L5)&","&UPPER(M5)&","&UPPER(N5)&","&UPPER(O5)&","&UPPER(P5)&","&UPPER(Q5)&","&UPPER(L6)&","&UPPER(M6)&","&UPPER(N6)&","&UPPER(O6)&","&UPPER(P6)&","&UPPER(Q6)&","&UPPER(L7)&","&UPPER(M7)&","&UPPER(N7)&","&UPPER(O7)&","&UPPER(P7)&","&UPPER(Q7)&","&UPPER(L8)&","&UPPER(M8)&","&UPPER(N8)&","&UPPER(O8)&","&UPPER(P8)&","&UPPER(Q8)&","&UPPER(L9)&","&UPPER(M9)&","&UPPER(N9)&","&UPPER(O9)&","&UPPER(P9)&","&UPPER(Q9)&","&UPPER(L10)&","&UPPER(M10)&","&UPPER(N10)&","&UPPER(O10)&","&UPPER(P10)&","&UPPER(Q10)&","&UPPER(L11)&","&UPPER(M11)&","&UPPER(N11)&","&UPPER(O11)&","&UPPER(P11)&","&UPPER(Q11)&","&UPPER(L12)&","&UPPER(M12)&","&UPPER(N12)&","&UPPER(O12)&","&UPPER(P12)&","&UPPER(Q12)&","&UPPER(L13)&","&UPPER(M13)&","&UPPER(N13)&","&UPPER(O13)&","&UPPER(P13)&","&UPPER(Q13)&","&UPPER(L14)&","&UPPER(M14)&","&UPPER(N14)&","&UPPER(O14)&","&UPPER(P14)&","&UPPER(Q14)&","&UPPER(L15)&","&UPPER(M15)&","&UPPER(N15)&","&UPPER(O15)&","&UPPER(P15)&","&UPPER(Q15)&","&UPPER(L16)&","&UPPER(M16)&","&UPPER(N16)&","&UPPER(O16)&","&UPPER(P16)&","&UPPER(Q16)&","&UPPER(L17)&","&UPPER(M17)&","&UPPER(N17)&","&UPPER(O17)&","&UPPER(P17)&","&UPPER(Q17)&","&UPPER(L18)&","&UPPER(M18)&","&UPPER(N18)&","&UPPER(O18)&","&UPPER(P18)&","&UPPER(Q18),O25,"")))/2

    Data 3.jpg

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    See my (updated) reply #8 as our replies crossed.

  11. #11
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Genius!

    Thank you.

    You've been a huge help.

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    You are very welcome. I enjoyed this because it was more helping with an application rather just simply providing formulae.

    And well done to you for the application you developed.

    Hope it all goes well. You deserve a pay rise!!!

  13. #13
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value


    If only - I'm a poor NHS worker, no pay rises here.
    Suspect the next thing will be to try and collate the responses from this workbook, think its gone out to about 15 people, will need to copy their sheets into my workbook and then display the info in both those straight tables i've (you've) been creating and then probably some run charts etc to do some comparisons.
    Feel free to offer suggestions

  14. #14
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Just spotted a flaw in the formula - Some of those codes are more than two characters long, eg C25, P10 etc
    The counts then don't work because its splitting everything down to 2 characters.

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Good spot!

    Do we have a mixture of code types i.e. C10, P5 can appear in the same Day ?

  16. #16
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Yes. Any number of different codes can all appear within the same cell (time window).

    Oh and to make it more fun I've just found out that actually its more like 40 people using this sheet that will need to be collated

  17. #17
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Two changes:

    In S5

    =SUBSTITUTE(SUBSTITUTE(L5 & ","&M5& ","&N5& ","&O5& ","&P5& ","&Q5,",","")," ","")

    I cannot remove zeros as you have codes such C10 , P10

    in U5

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you are on latest Excel there is function TEXTJOIN which can be used instead of above

    in V5

    =LEN($U5)

    This illustrates the (major) disadvantage of using text strings to record data. Complete redesign of data collection/input ???? !!!!

    You could hide columns S and U if required.

    I have not done a comprehensive check that nothing else is impacted by these changes.
    Attached Files Attached Files
    Last edited by JohnTopley; 02-25-2021 at 09:13 AM.

  18. #18
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    So the new calculation means the the daily overall count works but the hourly break down ones don't.

    I do have the latest version of excel.

    Unfortunately i can't alter this form for the moment but going forward i definitely would

  19. #19
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    For the Hourly Breakdown

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Divides by length of code being searched for rather a constant of 2


    And what are the implications of having 40 users of this system?
    Last edited by JohnTopley; 02-25-2021 at 11:36 AM.

  20. #20
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Sorry for the length of time its taken to come back to you. Had a call and also had to create a new bit of code as something went wrong.
    I think I've got it now though. Would appreciate you taking a look to see though.

    The idea of the Workbook is to understand workload across all of the 40 users, both as individuals and as a team in total. This obviously helps to be able to see those individuals but i'm not sure how i'll collate it for publishing the entire teams results.
    Attached Files Attached Files

  21. #21
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Attached is version with modifications: mainly SUBSTITUTE in columns S to W

    Add all daily data for "WEEK 1"

  22. #22
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    That looks great, thank you.
    Need to have a play with the idea of how to add the weekly data together, Thought i could count the instances within the 'transposed' data (B3:H82) but its having issues counting that due to either the lack of commas or the case sensitivity of the code, plus i think it just counts the first instance of code in a cell.

  23. #23
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Re your last post and the issue of counting: can you post a sample file, showing in the various input "errors" i.e no commas, case sensensitivity, as I thought these issued had been addressed.

    UPPER covers the case sensitivity (i thought) and lack of commas / blanks (between values)) does not appear to be a problem.

    How/who actual enters the data: is it transcribed from manually created sheets?

    Are you wanting a weekly summary which has the counts for a week's worth of data for a GIVEN code : so we put all the data for a week into a "workarea" but we can use the same base logic for the counts? Similary we can do an "all codes" count. Do you require monthly/quaterly/annual summaries?

    Given there are over a 100 codes, this is not an insignificant challenge!

    Are you or your employers averse to using VBA?
    Last edited by JohnTopley; 02-26-2021 at 06:54 AM.

  24. #24
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Hi,
    I think we would need to create another "Work Area" for all the weeks data to drop into, rather than just the daily one, i had just been trying to calculate the counts using the index info that is in that left-hand side (in blue - B3:H82) but that, as i said in my last post, wasn't working properly whereas with the work area we were able to add the various formula to make it more manageable.
    In theory the data should be being entered by the end user directly into the original spreadsheet however i suspect that some (many) of them may be entering the data into printed versions of it and i'll need to enter it by hand after the two week period. There is only two weeks worth of data being captured so we won't need a monthly or more summary - Just the daily (which we have) and then a weekly (possibly a total for the two weeks too). The weekly summaries just need the overall count for each code.
    I have no aversion to VBA other than my lack of knowledge of it

  25. #25
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Are you willing to have a go at the weekly version?

    Options:

    Choose "Daily" or "Weekly" if you only need a snapshot ... so you can use the same workarea but different formulae for filling the data, with modified dasboard

    (VBA might be useful to fill in the workarea if weekly to avoid long formula: thinking on the go here!)

    Or have a completely separate Weekly workarea set up as you currently have the for "Daily" with its own dashboard?

  26. #26
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    I think a totally separate weekly work area is the way forward - in fact possibly creating two rather than selecting which week you want given that there is only the two weeks.
    If i copy the calculations sheet and extend the work area down and then create a final sheet which will display the info separately.

  27. #27
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    Keep in touch if you have any problems but I am sure you will manage O.K.

  28. #28
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    LOL you have far more confidence in my talents than i do.

    I'll mark this topic as solved again. Thank you for all you're help.

  29. #29
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    Hi John,

    Spotted a small issue with this today (i'm just starting to get the original sheets from the users so was about to start filling it in) when the count column comes across a number with a 0 it counts it as if the zero wasnt there.

    eg:

    Attachment 723154

    The code its counting is C1

    Any ideas?

  30. #30
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    No file:see Yellow Banner

  31. #31
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    was just an image - is this working?
    Attached Images Attached Images

  32. #32
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    No - I need the workbookAttach a sample workbook (not image).so that we do not have to manually key in your data to do any testing.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  33. #33
    Registered User
    Join Date
    02-13-2014
    Location
    Newcastle upon Tyne, United Kingdom
    MS-Off Ver
    Excel 365
    Posts
    77

    Re: Formula to alter calculation dependant on drop down list value

    No problem, the workbook is the one you sent back last week.

    The problem is it counting codes similar to C25 or C10 in the C2 or C1 counts.

    The original requirements have slightly changed though now so it might make it easier to create, could i pm you my email address?

  34. #34
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    I changed to formula in S to add a comma to the end of the string

    =SUBSTITUTE(L5&","&M5&","&N5&","&O5&","&P5&","&Q5," ","")&","

    in U

    =SUM(LEN(T5)-LEN(SUBSTITUTE(T5,$O$25 & ",","")))/LEN($O$25 &",")

    so we compare "string" with added comma e.g "C1," "C10,"

    However if you don't have a comma between entries it will fail e.g "C25C25" is present in Week 1 - need "C25,C25". I changed to the latter.

  35. #35
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,351

    Re: Formula to alter calculation dependant on drop down list value

    The following has VBA code checks the daily input and corrects any invalid entry e.g "c25C25" is changed to "C25,C25"

    The code is Sheets "WEEK1" and "WEEK2" (already done for you)
    FYI:

    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Double click on Sheet "Calculations"
    Paste code into blank area on the right
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
    [B][I]



    Please Login or Register  to view this content.
    For each day in each week there is named range "(Wk1_Day1_rng", "Wk2-Day1_rng" etc)

    ENTER data in WEEK1 or WEEK2 so formulae in "Calcultations" are not overwritten
    Last edited by JohnTopley; 03-12-2021 at 12:00 PM.

+ 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] Dependant drop down list
    By gjw1971 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-04-2017, 03:58 PM
  2. Dependant drop list
    By csoup36 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-28-2016, 08:04 PM
  3. [SOLVED] Drop down lists dependant on previous drop down list
    By alexander.small in forum Excel General
    Replies: 6
    Last Post: 05-21-2014, 05:21 AM
  4. [SOLVED] Drop Down List that will alter data on my master tab?
    By excellerate_mmsa in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 10-15-2013, 02:21 PM
  5. Drop Down List dependant on 2 parameters
    By BlueGunner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2010, 11:18 PM
  6. Replies: 12
    Last Post: 12-09-2009, 04:19 PM
  7. Dependant drop down list and database value
    By Jonyork in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-24-2008, 10:50 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