Use If statement in Excel Solver - excel

Gone through lot of forums and other resources but couldn't find a solution for the same.
I have a column in excel called Priority with 3 unique values 1, 2 and 3 and is shown below
I want to put a constraint using this column such as:
If the value of the cell is 1 then the variable cells should get value no more than 5 but greater than zero
If the value of the cell is 2 then the variable cells should get value between 5 - 10
If the value of the cell is 3 then the variable cells should get value greater than 10
Objective: Is to distribute a number lets say 100 in 9 cells which takes care of the Priority condition
How can I do this ?

Related

Move the value of all cells in a column to their corresponding excel row number

Let's say i have the below list of Whole numbers in Column A. If you observe the list of numbers, you will see that number "5" and 6 is missing.
A
3
2
4
1
7
8
what I want to achieve is to place (sort) the numbers on the column such that each cell value will take its position according to excel row numbering. which means:
I should have something like this
1
2
3
4
7
If it's as simple as stated, this should work.
In column B, say:
=IF(COUNTIF(A:A,ROW())>0,ROW(),"")
Note: It does not account for duplicates, or anything complicated really.
Further Note: To clarify, all this does is check if the row that the formula is in, is in column A. If it is, then it returns the current row.

Excel counting cells based on complex criteria

Hate asking question about something as simple as an Excel formula, but seem to really need and would appreciate the help.
I have a table where the rows headings contains names and the column headings contains week numbers. Within this table I have differents numbers. Both numbers that are plus and negatives.
I want to count each cell where the row heading matches a specific name and then each cell that has a plus value with a week number less than or equal to a certain week.
I have tried to got it to work with at least some function (without it caring about plus and negative values) but haven't even gotten that to work.
I've tried with:
=SUMPRODUCT((Data!F3:F28=I1)*(Data!I2:BI2="<="&A1)*(Data!I3:BI28))
=SUMIFS(Data!I3:BI28;Data!F3:F28;I1;Data!I2:BI2;"<="&A1)
.............1 2 3 4 5
name1 -1 4 3 1 1
name2 0 0 0 0 0
I want a formula that counts for example every column header with a value less than or equal to (for example) 4, but excludes negatives and vice versa. So for the example above, the result of name1 should be 8; counts week 2, 3 and 4.
For your current example:
Formula in H3:
=SUMPRODUCT((B2:F3>=0)*(B1:F1<=4)*(A2:A3="name1"),B2:F3)

How to get max value in the column whilst counting and then reset count after reaching 0 and start to count until other max value is reached

I am trying to get the max value per run from my table. Each run lasts a different amount of days hence there will be a different max value for each run. My current table column Days looks like this:
Days:
1
2
3
4
5
6
7
8
0
1
2
3
4
5
0
1
2
3
4
5
6
7
8
9
10
11
0
1
2
3
I have another column called Max Day, where I want to get the max day per run from the above Days column, this is the output that I want to get at the end:
Max Days:
8
5
11
3
I have tried doing:
=COUNTIF(A$1:A1, A1) but that doesn't do anything, it just returns 0. Is there a way I can get the max value and then when it reaches 0, it starts counting again and retrieves the max value for that count and then repeat.
If you have Office 365, this is a piece of cake with the new Filter() function. In the screenshot, the formula has been entered into cell C2 and has NOT been copied down. It does that automatically.
=FILTER(A2:A31,A3:A32=0)
Edit - Explanation. For a general understanding of the new Excel Dynamic Array functions, please refer to this blog by the Excel team.
The Filter function returns all rows that match a given criterion. In this case the range to be filtered and the range in the criterion are offset by one row. The filter looks at rows 2 to 31, but the comparison looks at rows 3 to 32.
The effect is that the filter returns a value when the comparison is TRUE for the NEXT row, not the current row. Hence, the function returns all rows where the row FOLLOWING the current cell contains a zero.

Excel: Cumulative sum of min values of 2 columns without needing to create an extra column

I have two columns that I need to find the minimum value of, and then create a cumulative sum of them. I can do this by creating an extra column to hold the min value and then cumulative sum them, e.g.:
Col1 Col2 min(Col1, Col2) Cumulative Sum of Mins
1 3 1 1
4 2 2 3
3 5 3 6
Is there a way of doing this without creating the extra column?
I've tried sum(if(A$2:A2 < B$2:B2, A$2:A2, B$2:B2)) which I found (and modified) from another similar-but-not-similar-enough question, but this appears to just find the lowest value in the entire range and output that into a single cell; copying and pasting the formula into the other fields results in:
A value used in the formula is of the wrong data type
put this in C2 and copy down:
=IFERROR(--C1,0)+MIN(A2:B2)
Another approach is with SUMPRODUCT
=SUMPRODUCT(($A$2:A2<$B$2:B2)*($A$2:A2)+($A$2:A2>$B$2:B2)*($B$2:B2))
But this is an array type formula and as such every line this is copied down will increase the number of calculations exponentially. If too many lines are used the user will see a time delay in the calculations.

How do I make a cell value represent a number in Excel?

I have
Year 1 2 3 4 5 6
I'm trying to make it so that each year number 1-6 is equal to another number value i.e. Year 1 is equal to 5. Year 2 is equal to 6.
You will not be able to store one value in a cell and use a different value for calculation. However you may do this calculation with the help of a lookup from another table,
Assuming you have the years in Column A and the corresponding mappings are in Column E and F, you can use the below formula in Column B,
=INDEX(E:F,MATCH(A1,E:E,0),2) * 2
This formula lookups the value in A1 in the table E:F and returns the corresponding Column F element. That is finally multiplied with the 2 to show your result. Instead of just using just A1 for multiplying by 2, you should be using INDEX(E:F,MATCH(A1,E:E,0),2). Hope this helps.

Resources