Excel I/O problems using MATLAB 2017b or later /! Hi Alec de Zegher, Thanks for making this nice code! I've applied on my own data, however it shows the following error:??? Java exception occurred: java.lang.IllegalArgumentException: The workbook already contains a sheet of this name at org.apache.poi.xssf.usermodel.XSSFWorkbook.createSheet(XSSFWorkbook.java:619) I found someone has the similar error, however, I checked the potential reasons and found that these do not fit my case (i.e., 1. Use fullfile; 2. Load poi-ooxml-3.8-20120326.jar;poi-ooxml-schemas-3.8-20120326.jar). Could you please help me with that?
Thanks a lot! I'm so thankful xlwrite exists! First, a comment to those struggling to operate xlwrite: I found testxlwrite.m an easy lesson on xlwrite's capability. Appshrink dalamser announces jac digital for mac pro.
I did ralize to edit all of the javaaddpath path's to point to the right folder. After that, it worked like a charm.
Now, a question: I am eager to provide linefeeds (alt-enter) in my.xlsx output. I've tried (for hours) on the following: 1) A char for 'alt-enter'. 2) Various forms of ' r' and/or ' n'. 3) Kludging char(10) and/or char(13). Only #3 succeeded, but as I'm passing my.xlsx to windows users, I have horribly ugly cells: ='line one'&char(10)&char(13)&'line two'&. I have 10 lines in each cell, so it looks horrendous. (I also have to wake excel up and 'replace = with =' to auto-calculate the cells.) If anyone knows how to get xlwrite to populate a cell with 'line oneline two., please help me out!
Thank you so much! When I run this script to works fine until I use it as a function in another script. The issue is that the code skips over the import classes set of lines.
When this happens the workbooks in the switchcase are not defined. If I put a break in xlwrite and step through the code it skips the import section. If I highlight the import lines and F9 thereby forcing the import and click continue the rest of the code executes normally. What could be causing Matlab to skip the import of the org.apache.poi classes?
Thanks Alec, this is really useful particularly as I regularly change between PC and Mac (R2014b on OS X 10.11). I found as a couple of others have mentioned, having used xlwrite to write the data, xlsread either fails or only reads one line. This is due to order of parameters in the XML files. Typically I only saw Ben's solution from 06 Nov 2014 only after debugging it myself.
It's also a similar workaround to load in all the rows from the Excel document rather than just the first one. For convenience and completeness (and for those like me that fail to read below the first few comments!), the workarounds that work for me are: In folder. /Applications/MATLABR2014b.app/toolbox/matlab/iofun/private/.edit file xlsreadXLS.m inserting this in at line 200: if isempty(span.end) s = regexp(sheetData, ' d+. D+', 'names','all'); span.start = s(1).startCol1; span.end = ':', s(length(s)).startCol2; end.edit getSheetNames.m inserting this at line 21: if isempty(match) match = regexp(workbookxml. '.+?)(?=' r:id='rId' num2str(sheetIDs(i)),' sheetId='.'
/)'. 'names' ); end.
Thank you very much! However, I have one problem you might know how to solve. I use the function to add a row to an existing excel file. Therefore I first use the build-in xlsread function and ask for the number of rows. Check my Data. Directly after I use your function xlwrite(filename, DATA) to write the new DATA into the excel file.
It does the writing. When I open the excel file, a new line is added. However, when I read the excel file again using xlsread, without opening+saving the excel file outside Matlab, it does not recognize just added data. In my case it misjudges the number of rows and overwrites the previous added row. I'm using osx 10.11.3 and Matlab 2016a.
Do you recognize the problem and do you know how I can solve it? My remarks below apply to another version of xlwrite at: The present version works fine, once you figure out how to deal with the Java path, which is neither documented nor obvious. I put the POI library in a subdirectory of a directory I use during startup, then moved the javaaddpath commands from TestxlWrite to my startup.m and edited them to point to where I put the POI library, referencing it relative to where I execute the javaaddpath commands during startup. The javaaddpath commands populate a 'dynamic' Java path, and aren't meant for persistent use, but I have not been able to add to the 'static' Java path, I expect because of syntax of path designation.
I'll appreciate clear instructions on populating the static path, but for now the dynamic path works. The maintenance in File Exchange of two programs named xlwrite, with two series of updates to them, is very confusing - I'm surprised this is possible. @Gaurav and others facing that bug, This may be due to some unexpected formatting in some description xml file(s) in the xlsx. If you have write access to the matlab installation, you can fix it by editing the file MATLAB/R2014a/toolbox/matlab/iofun/private/getSheetNames.m replace line 12 with: '. And line 19 with: '.+?)(?=' sheetId='.' r:id='rId' num2str(sheetIDs(i)) ' s./)'.
I have not tested this fix extensively but I think it should not cause problems with other files. @Alec, Sorry for hijacking your comment section, but this is the number one page on google at the moment for that issue. Hi Alec, Thank you for your great work! But I have a problem. I'm using Mac OS X. Matlab 2013a.
I got the following error when run the TextxlWrite.m. Error using xlwrite (line 93) The POI library is not loaded in Matlab.
Check that POI jar files are in Matlab Java path! Files were loaded with no errors. I downloaded following jar files. I've run following codes. Javaaddpath('poilibrary/poi-3.8-20120326.jar'); javaaddpath('poilibrary/poi-ooxml-3.8.jar'); javaaddpath('poilibrary/poi-ooxml-schemas-3.8-beta4-20110826.jar'); javaaddpath('poilibrary/xmlbeans-2.3.0.jar'); javaaddpath('poilibrary/dom4j-1.6.1-hudson-1.jar'); javaaddpath('poilibrary/stax-api-1.0.1.jar'); javaaddpath('poilibrary/jxl.jar'); I got errors when the following code was run. Xlwrite(fileName, xlsData, sheetName, startRange).
I am getting the following error when trying to paste a 28900,14 cell array in an xlsx file. It seems my memory funs out? I have been using this on Windows and it is great. I have moved m code onto a linux machine and am encountering the following exception: java.lang.illegalArgumentException: Your InputStream was neither an OLE2 stream, nor an OOXML stream at.WorkbookFactory.create(WorkbookFactory.java (line 137 or xlwrite: xlsWorkbook = WorkbookFactory.create(fileIn)) I am trying to create an xlsx file which has been working flawlessly in windows. I have checked all the.jar dependencies and they are identical on my windows install as the linux one. Any suggestions to help fault-finding? Oups my last post has been deleted.
Actually, i've got the following error Error using xlwrite (line 179) Java exception occurred: java.lang.IllegalArgumentException: The workbook already contains a sheet of this name at org.apache.poi.xssf.usermodel.XSSFWorkbook.createSheet(XSSFWorkbook.java:619) at org.apache.poi.xssf.usermodel.XSSFWorkbook.createSheet(XSSFWorkbook.java:70) when i used xlwrite several times on a new workbook with a specific worksheet (e.g. The function created the workbook with one sheet named 'sheet 8'. So when i tried to use xlwrite again on the 8th sheet, xlwrite didn't recognized 'sheet 8' as the 8th spreadsheet and tried to create a newer with the name 'sheet 8'. This induced the above error. You're right, my PoiLibrary was not loaded. -' But after that, I still got an error: Error using xlwrite (line 286) Java exception occurred: java.io.FileNotFoundException: /Documents/Recherche/Etude Course vs Bondissements/Donnees/Fichiers Sujets/Cyril Schmit2/Analyse Force Cyril Schmit2.xlsx (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:194) at java.io.FileOutputStream.(FileOutputStream.java:84) Actually, i had recently changed my laptop to the macbook pro and realized that, with MacOS X, the path filename attribution method is not as easy as Windows. After multiple trial, i realized that the relative mode didn't work with XlWrite.
Therefore, the path filename have to be loaded in absolute mode (starting with /User/username/etc.) with MacOS X Don't know if it's mentioned in the Help section. Guillaume P.S: Sorry for my poor english skills. Very, Very Nice function!!! Thanks for the submission I would just like to know, is it possible to write on specific path file? I'm working with MACOS X (Mavericks) and when i tried to write in excel spreadsheet out of the matlab path folder the following error appeared: Error using xlwrite (line 148) Java exception occurred: java.lang.NoClassDefFoundError: Could not initialize class org.apache.xmlbeans.XmlBeans at org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook$Factory.newInstance(Unknown Source) at org.apache.poi.xssf.usermodel.XSSFWorkbook.onWorkbookCreate(XSSFWorkbook.java:290) at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:170). @Jeremy: This is a bug in the implementation of XLSREAD.
When opening an XLSX on a Mac, XLSREAD opens it in 'basic' mode. The 'basic' mode in XLSREAD has a bug when opening XLSX. If you try ,b,c = xlsread('myXlsx.xls', 1, ', 'basic') on your windows PC you will see the same bug. I would recommend to save the file as XLS if possible.
@Barry: There is no plan to create an xlsread version with the POI library. Did you try using the xlsread in 'basic' mode? This should normally avoid the 'Could not start Excel server.' @Mario: Thanks! @Thierry: thanks for the recommendations! 1) The Stax library should indeed also be loaded. This will be fixed in next release.
Solved Excel For Mac Free Download
2) Originally we also wanted to add an auto-load function, but we ran into the issue that the POI folder location is unknown. It is allowed to be anywhere on your computer. For example in our matlab-webapplications, the POI libraries are put next to the other java libraries in a central folder.
To keep it as generic as possible we decided to throw an error if it is not loaded. 3)xlwrite replacing NaN with the previous number is indeed a bug. This was solved in the update of. Best Regards, Alec. 1.It seems you also need to javaaddpath the stax.jar to get it work, right?
(it is omitted in the testxlwrite). I would add something like this in the beginning of xlwrite: if exist('org.apache.poi.ss.usermodel.WorkbookFactory', 'class') = 8.% exist('org.apache.poi.hssf.usermodel.HSSFWorkbook', 'class') = 8.% exist('org.apache.poi.xssf.usermodel.XSSFWorkbook', 'class') = 8% auto-initialize javadir=fullfile(fileparts(mfilename('fullpath')),'poilibrary'); jarfiles=dir(javadir,'.jar'); javaaddpath(jarfiles); 2. Looking for an ocr software for mac reviews. Xlwrite replace NaN by previous numeric values whereas xlswrite replace NaN by empty cell.
Hi and thanks for the much needed submission:) I have been using the function for some weeks now without problem. Recently I tried to use it in the code of a simple GUI that I implemented and for some reason nothing works. More specifically, I have o command of the type: xlwrite('test.xls',M,'A1') and get the following error:??? No method 'getSheet' with matching signature found for class 'org.apache.poi.hssf.usermodel.HSSFWorkbook'.
Error in xlwrite at 161 xlsSheet = xlsWorkbook.getSheet(0); If I set the sheet to 1, I get:??? Java exception occurred: java.lang.IllegalArgumentException: Sheet index (0) is out of range (0.-1) Note that everything works fine when I save my variables in the workspace and use the same code from the command line (so it obviously has to do with the GUI). Any idea if/how I can work around this? Any help would be much appreciated! Thanks, Marianna. @ Peter This error is caused because the jxl.jar (JExcelApi) package is not loaded correctly in your workspace. Check that you extracted correctly the jxl.jar file from the zip file.
You should not forget to add the jxl.jar file to your Matlab Java path as explained in testxlwrite. If jxl.jar is in the same directory as your current workspace: you should execute the 'javaaddpath('jxl.jar');' command.
If jxl.jar is not in the same directory as your current workspace, you should execute the 'javaaddpath(' FULL PATH TOjxl.jar');'. Please let me know if this solves your problem or not. Alec Please let me know. 27 Feb 2013 1.9.0.0 20130227 - Fixed bug when no sheet number given & added Stax to java load. Thanks to Thierry 25 Jan 2013 1.8.0.0 20130125 - Fixed bug & documentation.
Incorrect working of NaN. Thanks Klaus 6 Jan 2013 1.7.0.0 Fixed bug: use existing cell if present, instead of overwriting. This way original XLS formatting is kept & not overwritten.
4 Dec 2012 1.6.0.0 Bugfix: if a numeric sheet was given & didn't exist an error was returned instead of creating the sheet. Thanks to Marianna 27 Nov 2012 1.5.0.0 Fixed bug: use existing rows if present, instead of overwrite rows by default. Thanks to Dan & Jason. 27 Nov 2012 1.2.0.0 Fixed bug: use existing rows if present, instead of overwrite rows by default.
Thanks to Jason. 2 Nov 2012 1.1.0.0 The new version of xlwrite uses the Apache POI library, instead of JExcelApi. The Apache POI library has some advantages over JExcelApi library: - It can create XLSX files - xlsread supports xls files generated by POI lib.
Under Add-ins, select Solver Add-in and click on the Go button. Check Solver Add-in and click OK. You can find the Solver on the Data tab, in the Analyze group. Formulate the Model The model we are going to solve looks as follows in Excel. To formulate this linear programming model, answer the following three questions.
What are the decisions to be made? For this problem, we need Excel to find out how much to order of each product (bicycles, mopeds and child seats). What are the constraints on these decisions? The constrains here are that the amount of capital and storage used by the products cannot exceed the limited amount of capital and storage (resources) available. For example, each bicycle uses 300 units of capital and 0.5 unit of storage. What is the overall measure of performance for these decisions? The overall measure of performance is the total profit of the three products, so the objective is to maximize this quantity.
To make the model easier to understand, the following ranges. Range Name Cells UnitProfit C4:E4 OrderSize C12:E12 ResourcesUsed G7:G8 ResourcesAvailable I7:I8 TotalProfit I12 3. Insert the following three SUMPRODUCT functions. Explanation: The amount of capital used equals the of the range C7:E7 and OrderSize. The amount of storage used equals the sumproduct of the range C8:E8 and OrderSize. Total Profit equals the sumproduct of UnitProfit and OrderSize.
Trial and Error With this formulation, it becomes easy to analyze any trial solution. For example, if we order 20 bicycles, 40 mopeds and 100 child seats, the total amount of resources used does not exceed the amount of resources available. This solution has a total profit of 19000. It is not necessary to use trial and error. We shall describe next how the Excel Solver can be used to quickly find the optimal solution. Solve the Model To find the optimal solution, execute the following steps. On the Data tab, in the Analyze group, click Solver.
Enter the solver parameters (read on). The result should be consistent with the picture below. You have the choice of typing the range names or clicking on the cells in the spreadsheet.
Enter TotalProfit for the Objective. Enter OrderSize for the Changing Variable Cells. Click Add to enter the following constraint. Check 'Make Unconstrained Variables Non-Negative' and select 'Simplex LP'. Finally, click Solve. Result: The optimal solution: Conclusion: it is optimal to order 94 bicycles and 54 mopeds.
This solution gives the maximum profit of 25600. This solution uses all the resources available.
The CSV processor on Numbers is very buggy Not very helpful. The escaped double-quotes are interfering with the processing, causing the internal commas to be mis-interpreted as delimiters. I started looking around for other editors. I briefly looked at a CSV editor called, but found that its editing powers were really quite limited. Most critically, it had no ability to do a find and replace, and it could not copy or paste columns from other programs like Excel. Eventually, I took a look at.
The spreadsheet tool can correctly read files in UTF-8, and it has all of the search and replace functions I need. It appears to be modeled on the Windows version of Microsoft Excel. Form co7 word mojo gold online for mac.
I did run into a small hitch when trying to save the file, however. It handled the UTF-8 encoding without a problem at all, but for some reason it saved it in tab-delimited format instead of CSV.
However, when I checked the “Edit Filter Settings” button at the bottom of the “Save As” dialog, it gave me options for the encoding, field delimiter, and text delimiter.
Hi, I have information on several lines in one cell that needs to be separated into several cells in Excel for Mac 2011. Cell B2 is as follows: Years in Practice: 20 Years License No. And State: MH34202 Florida Supervisor: Jane Doe Supervisors License No. MH38799 Cell B3 is as follows: Years in Practice: 4 Years School: University of Florida Year Graduated: 2008 License No.
And State: MH10876 I need this information extracted into separate cells. The information in the core cell is separated by line breaks as shown above. The headings will match the question, i.e. Column C will be labeled Years in Practice so I need C2 to extract the number of years found in cell B2 and left blank if the information is not there. Column D will have a heading with Year Graduated and so on.
Does this make sense? Not every cell containing the the core information has all the same information, as shown above.
The tutorial explains how to add and where to find Solver in different Excel versions, from 2016 to 2003. Step-by-step examples show how to use Excel Solver to find optimal solutions for linear programming and other kinds of problems. Everyone knows that Microsoft Excel contains a lot of useful functions and powerful tools that can save you hours of calculations. But did you know that it also has a tool that can help you find optimal solutions for decision problems?
In this tutorial, we are going to cover all essential aspects of the Excel Solver add-in and provide a step-by-step guide on how to use it most effectively. What is Excel Solver? Excel Solver belongs to a special set of commands often referred to as What-if Analysis Tools. It is primarily purposed for simulation and optimization of various business and engineering models.
The Excel Solver add-in is especially useful for solving linear programming problems, aka linear optimization problems, and therefore is sometimes called a linear programming solver. Apart from that, it can handle smooth nonlinear and non-smooth problems.
Please see for more details. While Excel Solver can't crack every possible problem, it is really helpful when dealing with all kinds of optimization problems where you need to make the best decision. For example, it can help you maximize the return of investment, choose the optimal budget for your advertising campaign, make the best work schedule for your employees, minimize the delivery costs, and so on.
How to add Solver to Excel The Solver add-in is included with all versions of Microsoft Excel beginning with 2003, but it is not enabled by default. To add Solver to your Excel, perform the following steps:.
In Excel 2010, Excel 2013, and Excel 2016, click File Options. In Excel 2007, click the Microsoft Office button, and then click Excel Options.
In the Excel Options dialog, click Add-Ins on the left sidebar, make sure Excel Add-ins is selected in the Manage box at the bottom of the window, and click Go. In the Add-Ins dialog box, check the Solver Add-in box, and click OK: To get Solver on Excel 2003, go to the Tools menu, and click Add-Ins. In the Add-Ins available list, check the Solver Add-in box, and click OK. The examples discussed in this tutorial use Solver in Excel 2013. If you have another Excel version, the screenshots may not match your version exactly, although the Solver functionality is basically the same.
How to use Solver in Excel Before running the Excel Solver add-in, formulate the model you want to solve in a worksheet. In this example, let's find a solution for the following simple optimization problem. Supposing, you are the owner of a beauty salon and you are planning on providing a new service to your clients. For this, you need to buy a new equipment that costs $40,000, which should be paid by instalments within 12 months. Goal: Calculate the minimal cost per service that will let you pay for the new equipment within the specified timeframe. For this task, I've created the following model: And now, let's see how Excel Solver can find a solution for this problem.
Run Excel Solver On the Data tab, in the Analysis group, click the Solver button. Define the problem The Solver Parameters window will open where you have to set up the 3 primary components:. Objective cell. Variable cells. Constraints Exactly what does Excel Solver do with the above parameters? It finds the optimal value (maximum, minimum or specified) for the formula in the Objective cell by changing the values in the Variable cells, and subject to limitations in the Constraints cells. Objective The Objective cell ( Target cell in earlier Excel versions) is the cell containing a formula that represents the objective, or goal, of the problem.
The objective can be to maximize, minimize, or achieve some target value. In this example, the objective cell is B7, which calculates the payment term using the formula =B3/(B4.B5) and the result of the formula should be equal to 12: Variable cells Variable cells ( Changing cells or Adjustable cells in earlier versions) are cells that contain variable data that can be changed to achieve the objective. Excel Solver allows specifying up to 200 variable cells. In this example, we have a couple of cells whose values can be changed:.
Projected clients per month (B4) that should be less than or equal to 50; and. Cost per service (B5) that we want Excel Solver to calculate. If the variable cells or ranges in your model are non-adjacent, select the first cell or range, and then press and hold the Ctrl key while selecting other cells and/or ranges. Or, type the ranges manually, separated with commas.
Constraints The Excel Solver Constrains are restrictions or limits of the possible solutions to the problem. To put it differently, constraints are the conditions that must be met. To add a constraint(s), do the following:.
Click the Add button right to the ' Subject to the Constraints' box. In the Constraint window, enter a constraint. Click the Add button to add the constraint to the list. Continue entering other constraints. After you have entered the final constraint, click OK to return to the main Solver Parameters window. Excel Solver allows specifying the following relationships between the referenced cell and the constraint.
Less than or equal to, equal to, and greater than or equal to. You set these relationships by selecting a cell in the Cell Reference box, choosing one of the following signs: =, and then typing a number, cell reference / cell name, or formula in the Constraint box (please see the above screenshot). If the referenced cell must be an integer, select int, and the word integer will appear in the Constraint box.
Different values. If each cell in the referenced range must contain a different value, select dif, and the word AllDifferent will appear in the Constraint box. If you want to limit a referenced cell either to 0 or 1, select bin, and the word binary will appear in the Constraint box. The int, bin, and dif relationships can only be used for constraints on Variable cells. To edit or delete an existing constraint do the following:.
In the Solver Parameters dialog box, click the constraint. To modify the selected constraint, click Change and make the changes you want. To delete the constraint, click the Delete button. In this example, the constraints are:.
B3=40000 - cost of the new equipment is $40,000. Tips:. If the Excel Solver has been processing a certain problem for too long, you can interrupt the process by pressing the Esc key. Excel will recalculate the worksheet with the last values found for the Variable cells.
To get more details about the solved problem, click a report type in the Reports box, and then click OK. The report will be created on a new worksheet: Now that you've got the basic idea of how to use Solver in Excel, let's have a closer look at a couple more examples that might help you gain more understanding. Excel Solver examples Below you will find two more examples of using the Excel Solver addin. First, we will find a solution for a well-known puzzle, and then solve a real-life linear programming problem. Excel Solver example 1 (magic square) I believe everyone is familiar with 'magic square' puzzles where you have to put a set of numbers in a square so that all rows, columns and diagonals add up to a certain number. For instance, do you know a solution for the 3x3 square containing numbers from 1 to 9 where each row, column and diagonal adds up to 15? It's probably no big deal to solve this puzzle by trial and error, but I bet the Solver will find the solution faster.
Our part of the job is to properly define the problem. To begin with, enter the numbers from 1 to 9 in a table consisting of 3 rows and 3 columns. The Excel Solver does not actually need those numbers, but they will help us visualize the problem. What the Excel Solver add-in really needs are the that total each row, column and 2 diagonals: With all the formulas in place, run Solver and set up the following parameters:. Set Objective. In this example, we don't need to set any objective, so leave this box empty. Variable Cells.
We want to populate numbers in cells B2 to D4, so select the range B2:D4. Constraints. The following conditions should be met:. $B$2:$D$4 = AllDifferent - all of the Variable cells should contain different values. $B$2:$D$4 = integer - all of the Variable cells should be integers. $B$5:$D$5 = 15 - the sum of values in each column should equal 15. $E$2:$E$4 = 15 - the sum of values in each row should equal 15.
$B$7:$B$8 = 15 - the sum of both diagonals should equal 15. Finally, click the Solve button, and the solution is there! Excel Solver example 2 (linear programming problem) This is an example of a simple transportation optimization problem with a linear objective.
More complex optimization models of this kind are used by many companies to save thousands of dollars each year. Problem: You want to minimize the cost of shipping goods from 2 different warehouses to 4 different customers. Each warehouse has a limited supply and each customer has a certain demand. Goal: Minimize the total shipping cost, not exceeding the quantity available at each warehouse, and meeting the demand of each customer.
Source data Here is how our transportation optimization problem looks like: Formulating the model To define our linear programming problem for the Excel Solver, let's answer the 3 main questions:. What decisions are to be made?
We want to calculate the optimal quantity of goods to deliver to each customer from each warehouse. These are Variable cells (B7:E8). What are the constraints?
The supplies available at each warehouse (I7:I8) cannot be exceeded, and the quantity ordered by each customer (B10:E10) should be delivered. These are Constrained cells. What is the goal? The minimal total cost of shipping.
And this is our Objective cell (C12). The next thing for you to do is to calculate the total quantity shipped from each warehouse (G7:G8), and the total goods received by each customer (B9:E9). You can do this with simple Sum formulas demonstrated in the below screenshot. Hello, please i was giving this assignment but i am finding it hard to understand it. Please can any one help me solve it? To create a Linear Programming model using MS Excel Solver (25%) A metal works manufacturing company produces four products fabricated from sheet metal in a production line that consist of four operations: 1) Stamping, 2) Assembly, 3) Finishing and 4) Packaging.
Solved Excel For Mac 2011
I created a workbook for scheduling hours for employees working at a movie theater for 1 week. I need to have a certain number of employees for each day of the week, but I need to deal with their timeoff requests. And some of my employees are fulltime and some parttime. The timeoff request says 'Can't work Saturday'. I need to write a constraint based on those entries, add constraints so that employees are not scheduled to work on days when they are unavailable to work. How do I write a constraint to cover this?