Excel nested if formulas - excel

I've currently got a Uni project underway and part of this project is an excel spreadsheet which involves inputting data (to be later to be outputted).
Anyway, I don't have too much experience with Excel or programming at all, and I've come across a situation where I need some help.
The project involves building a climbing frame, using EITHER the material Wood, Steel or Aluminium.
In the input table, I have added a "Material Quantity" row where a user can select the material they would like to use (from the above list), and then the amount of material they want to use.
The problem is that the materials Steel and Aluminium can ONLY be provided in increments of 6 metres, while Wood can only be provided with an increment of 1 metre.
As you can guess, I want to create something where a user can select their chosen material and then ONLY be able to enter a amount with the same multiple of what it can be provided in. For example, if a user selects "Steel", they can only enter a value with a multiple of 6m - if they enter, for example, 10m, then I want it to return a error.
After some reading, I think the way to solve this problem is to use a nested IF statement with a MOD command too. If anyone can help me with the forumla it would be much appreciated.
The attached picture is what I've acheived so far (and an idea for you guys to see what I'm dealing with). I really have no clue how to approach the problem :(

Use this formula:
=OR(AND(E8="Wood",MOD(F8,1)=0),AND(OR(E8="Steel",E8="Aluminium"),MOD(F8,6)=0))

Another option would be to allow the user to input the exact length of material and then calculate the amount they will need using the 'MROUND' function.
=IF(OR(E8="steel",E8="aluminum"),MROUND(F8,6),IF(E8="wood",MROUND(F8,1),"Not valid"))

Related

Filling in an array (table) with no Horizontal (row) or Vertical (column) duplicates formulaically in Excel

This may be impossible, but I am trying to create a baseball fielding lineup generator that has a few constraints provided by the league (ie. must play twice in infield, twice in outfield, no repeats at any position). I think this would be fairly simple task using any programming language, but I am designing this for my 70yo uncle and he can basically only use excel with no macros. So I can't brute force my way through the problem and I don't think I understand the mathematics behind the problem well enough to even know if there is a excel formulaic solution.
At it's essence it's a Sudoku creator and solver with no repeats in the rows or columns. I have an ok solution for the infield/outfield part via ranking the individuals by position.
Recursively calculating with F9 is ok for the solution since this is just a change in the options menu, but the last time I sent him a macro his university MS account wouldn't let him run it or change the settings.
Well, I have plenty of other info and have gotten close to solutions using huge nested IFs, but this relatively brute force method seems to be pretty dumb and is not giving great solutions.
Thanks for any help!
Well if your uncle has access to Excel 365 (sounds like a big if), you could use sorting to remove players already used in a given row or column, e.g. like this copied down and across from B2:
=LET(range,$L$2:$L$27,
choice,IF(COUNTIF(B$1:B1,range)+COUNTIF($A2:A2,range)=0,range),
count,COUNT(choice),
sort,SORT(choice),
INDEX(sort,RANDBETWEEN(1,count)))
If the players were given names instead of numbers, you could try
=LET(range,$L$2:$L$27,
choice,IF(COUNTIF(B$1:B1,range)+COUNTIF($A2:A2,range)=0,range),
count,SUM(--ISTEXT(choice)),
sort,SORT(choice),
INDEX(sort,RANDBETWEEN(1,count)))

Power BI | Filter and select values higher than a reference, GIVEN ADDITIONAL conditions

I've been recently hired as an intern, and a challenge my area has come accross is how to highlight the closest available medical appointment.
Of course, I know that in excel such a thing would be pretty simple, with a matrixial formula like {=MIN(IF( range > current_date_and_time ; range ))} and as such, in PowerBi it should be just as simple.
However, the PowerBi table the area is dealing with shows the entire agenda and another column indicates if it has been reserved or not (with a 1 and 0). So, I'm wondering how to incorporate this condition toe excel formula, and in the end, how to get the closest AVAILABLE appointment in the agenda.
Eventually, the idea is to apply this "filter" for each doctor, and then aggregate by area.
I also know that good manners dictate I show you the data, but this is work related, so I can't do that.
Thanks beforehand, and sorry for the trouble
the problem has been solved, though by means of a different answer. THANKS

Best way to create a process step diagram in Excel

Consider below set up:
Whenever you enter value under Time, it will be mapped on the right side under Process Time using the correct line legend depending on what column you enter your input.
I know my question would be a bit off topic or too broad, but I was hoping that someone may share their idea on how to accomplish the same other than VBA. I am currently doing this using Change_Event but this may be hard to maintain as steps may vary as well as the time intervals.
I also come-up with another solution using Conditional Formatting (same as the available template that Excel 2013 offers - Project Planner) but my customer wish to (as much as possible) preserve the legends.
So before I go on optimizing the current routine I've written, I want to consult on the communities opinion if I am on the right track on using brute force VBA (automating inserting and deleting lines) or if there is a simpler way. I just felt that maybe I am overdoing things (especially on the freeform line)
I had already a solution for this without VBA. But of course the legend symbols must be character glyphs. So they are not as flexible as you need. But maybe you get stimuli how programming this in VBA from this.
There is only one Formula in F4 copied cross down.
=IF(AND(SUM($B$3:$E3)<F$2,SUM($B$4:$E4)>=F$2),REPT(CHOOSE(MATCH(0,$B4:$E4,-1),"—","-","~","═"),4),"")
Row 3 must be empty. All times must be multiples of 10. And there is only one kind of process possible in each step. The cells F4:O10 must be formatted with a proportional font.

Building a customized, fuzzy and multiple Vlookup

Ok so, twice a month I receive a large file of about 100 rows, which contains 4 columns:
Building name - value - county - state
I´ve to complete 2 other columns based on a master list that have thousands of entries.
I want to produce something very similar to this fabulous add-in (http://www.microsoft.com/en-us/download/details.aspx?id=15011), but a bit simpler and that I could use at work without problems.
What I need to do is the following:
In order to match my input with the master file, I know the county and state must match, but then, the building names can change a bit in each file for the same building (ie "John Miller #34" can be "Miller, John 34 A"), and that the values may vary but not too much.
Based on that, I want to bring from the master to my file, all the entries that may match each of my rows, filtering by County and State first, and then by similarity in name and value.
Could you please share your thoughts on how you´d approach this?
I know this is not a simple thing, but anything may help!
You could also use wildcards to try and match on the primary identifier within the name. from your example, that might be "Miller", for example.
Unfortunately for you, the vlookup "fuzzy logic" is nowhere near reliable for your purpose (see the comment on my answer below for details), and you won't have any indicator as to whether the returned result is accurate or not.
It's possible to get 100% of what you want through some heavy coding in a user-defined function, but this is probably well beyond your comfort zone.
A clunky solution, although somewhat easy to explain and adopt, is to create an "identity column" for every unique scenario that can occur. So, for example:
Then you can import your master sheet and add the same identity column to the left, and perform your vlookup. When a new configuration is added you can just add that to the master list and it will populate in your imported file in future instances.
That said, if you are interested in learning, there have been many people who have walked in your shows and felt your pain. You may want to indulge in this:
http://www.mrexcel.com/forum/excel-questions/195635-fuzzy-matching-new-version-plus-explanation.html
Because what you are truly requesting is an algorithm. It's not a simple thing, but it's very possible. And if you take the time to learn you not only solve your immediate problem, but make yourself marketable as an Excel wiz. Good luck!

Excel - replace a formula cell with its result automatically

I am trying to make a sheet to add to templates that I give to my students for homework assignments; some of them are cheating by sending each other the files and I would like to catch them.
I have made a formula cell that populates with the current OS and directory of the file. What I would like to do is have this become text after evaluation so that if another student opens the file it will not change (but the following cell will, and so on..) Here is the formula:
(Cell A1):
=INFO("osversion")&INFO("directory")
(Cell A2 and beyond):
=IF(A1=(INFO("osversion")&INFO("directory")),"",IF(LEN(A1)<2," ",INFO("osversion")&INFO("directory")))
Do you know if there is any way to have a formula cell be replaced by its value after execution without using VBA? (If I use VBA it asks if you want to enable macros on startup which kind of gives the game away...)
Thank you in advance for your help!
There is a workaround: Use Track Changes. If you are using Excel 2010, for example:
Go to the Review tab and in the Changes group click Share Workbook.
Click the checkbox for Allow changes by more than one user at the same time.
In the Review tab, select Track Changes|Highlight Changes.
You may wish to select All for the When option and Everyone for the Who option.
You can then choose to highlight changes on screen and/or list changes in a new sheet.
If you do that before you make your final changes to the file, you can confirm that nobody has Accepted Changes between the last time you saw the file and the time it is returned to you by checking that your last change is shown correctly.
That will then let you see all the people who have edited the file since you last edited it, and what changes they have made.
(EDIT)
As #Siddharth Rout pointed out in another answer, one can use technological means to make cheating on assignments more difficult but a sufficiently resourceful student can always find a way to circumvent such measures.
This predicament can be resolved by distinguishing two cases:
(a) learning opportunities where students can choose to learn (do the assignment and get feedback on their approach - not a mark) or not choose to learn, and
(b) evaluation processes where one can measure how much they have learned (e.g. by getting the students together under one roof).
In case (a) students are not being evaluated and so have no motivation to "cheat". In case (b), they are being evaluated but have no opportunity to cheat.
Do you know if there is any way to have a formula cell be replaced by its value after execution without using VBA?
The answer to your question is "No, it cannot be done"
Even if you considered VBA as an option, it's futile as this is a classic example of XY Problem.
No matter what you do, you cannot stop your students from cheating. Consider these few scenarios.
Scenario 1
Student A has 1.xlsx. Student B has 2.xlsx. After student A finishes his/her assignment, he/she create a copy of 1.xlsx. Let's call it Copy.xlsx. Now Student A gives Copy.xlsx to Student B. Student B opens Copy.xlsx and copies the answers into 2.xlsx. Once finished, Student B deletes Copy.xlsx and gives you 2.xlsx. So now tell me how will you know Student B cheated?
Scenario 2
Student B calls Student A on mobile. They both have their copies opened. Student A gives all the answers on the phone. How will you know Student B cheated?
Scenario 3
Student A and Student B open files in two laptops next to each other and finish the assignment. How would you know who cheated whose assignment?
Alternative?
Get all the students under one roof and then get them fill it up in front of you. There is no other way you can even guess whether someone cheated unless someone is fool enough to mention other students name in his/her template or copied the answers verbatim.
You could always put some text in a cell location that only you know about and make the text white. You could code your text for each student and lock only the contents of that one cell with a password.
That's what I would do...
You can give each of them a different problem (maybe the same problem with different data). You will detect cheating of any kind by just looking at the results.
Programming or IT is not always the solution, even to programming or IT problems.

Resources