How to add a 'at least X' in a solver solution - Excel - excel

I've developed a solver solution in my excel document where it automatically selects the lowest price in a SUMPRODUCT situation.
To make everything simpler, there is a picture of the actual spreadsheet below. Take into account that =SOMARPRODUTO is actually =SUMPRODUCT in english.
What i'm currently trying to add and haven't been successfull yet, is making a restriction based on another cell.
For example, the solver can only consider solutions from the row [B4:AU4] that have a number higher than the one in the cell [$AW$7].
Perhaps i need to make a if condition and then use the SUMPRODUCT formula?
If the question is not explicit as it should be, please let me know and i'll add more information to it.

You can try this =SOMARPRODUTO((B4:AU4>=$AW$3)*B5:AU5,B6:AU6)
Let me know if it works for you.

You should use a boolean statement to solve your issue,
=IF(CONDITION,PASSED,FAILED)
Basically, just add your SUM function to the PASSED section and your cell verification ($AW$7) to your condition.

Related

Macro that finds value given 3 conditions

I need help creating a macro that finds a value given 3 conditions, year, quarter and color. I realize that the easiest way to solve this is by creating a pivot table, but I was asked to solve this using a macro.
Here is what the table looks like, I need to be able to find the value in C12 given the conditions around it.
I appreciate your time and any advice would be pleasantly taken.
You can use the following formula for the worksheet in your question.
=OFFSET($B$2,MATCH($B$12,$B$2:$B$7,0)-1,MATCH($C$11,OFFSET($C$3:$F$3,0,MATCH($C$10,$2:$2,0)-COLUMN($B$2)-1),0)+MATCH($C$10,$2:$2,0)-COLUMN($B$2)-1)

Index/Small with multiple criteria, multiple results, and wild card

I am basing my question on the instructions that I found at this link
on eImagine.
I followed the instructions to return lists based on one criteria item. It worked well. The initial formula is below:
{=IF(ISERROR(INDEX('Data 6.26.18'!$A$2:$AR$6000,SMALL(IF('Data 6.26.18'!$V$2:$V$6000=Summary!$A22,ROW('Data 6.26.18'!$V$2:$V$6000)-1),COLUMN()-3),14)),"",INDEX('Data 6.26.18'!$A$2:$AR$6000,SMALL(IF('Data 6.26.18'!$V$2:$V$6000=Summary!$A22,ROW('Data 6.26.18'!$V$2:$V$6000)-1),COLUMN()-3),14))}
However, when I tried to add a second criteria item, things didn't work as well. I assume that the SMALL function doesn't work well with AND statements, and piling wild card logic on top of that might not help. The formula that I attempted is below:
{=IF(ISERROR(INDEX(Current!$A$2:$AQ$6000,SMALL(IF(AND(Current!$V$2:$V$6000=Summary!$A17,Current!$S$2:$S$6000="*Open/Active*"),ROW(Current!$V$2:$V$6000)-1),COLUMN()-3),14)),"",INDEX(Current!$A$2:$AQ$6000,SMALL(IF(AND(Current!$V$2:$V$6000=Summary!$A17,Current!$S$2:$S$6000="*Open/Active*"),ROW(Current!$V$2:$V$6000)-1),COLUMN()-3),14))}
Can anyone help me understand what I might need to do make this work? For clarity, I pulled these two formulas from different cells that match on different reference cells ($A$17 and $A$22). Otherwise, I am hoping to make the latter input formula work for both cells.
Please let me know if further background on the referenced spreadsheet would help.
You may try to incorporate another IF() within your IF() since AND() doesn't work with arrays. So basically, it would look like:
IF(Current!$V$2:$V$6000=Summary!$A17,IF(Current!$S$2:$S$6000="*Open/Active*",....
Or you could as well try:
IF((Current!$V$2:$V$6000=Summary!$A17)*(Current!$S$2:$S$6000="*Open/Active*"),...
Tested the first one as working, but haven't really tried the second one. It would be great if the second one did work since it's easier to understand.

Netted If Statement

I need a formula to tell me whether a value in a specific cell is within a certain range. The formula below keeps producing the output ">$75" even for numbers below 75K. Can anyone help me out with this? Thanks so much!
=IF(N2>100000,">$100K",IF(99999.99>N2>75000,">75K",IF(74999.99>N2>50000,">$50K",IF(49999.99>N2>30000,">$30K",IF(29999.99>N2>20000,">$20K",IF(19999.99>N2>10000,">$10K","<$10K"))))))
Excel does not allow the 99999.99>N2>75000 It would be AND(99999.99>N2, N2>75000)
But you can simplify this to:
=INDEX({"<$10K",">$10k",">$20K",">$30K",">$50k",">$75k",">$100k"},MATCH(N2,{0,10000,20000,30000,50000,75000,100000}))
If you really want the IF, then realize that IF resolves in order and the AND talked about above is not needed.
=IF(N2>100000,">$100K",IF(N2>75000,">75K",IF(N2>50000,">$50K",IF(N2>30000,">$30K",IF(N2>20000,">$20K",IF(N2>10000,">$10K","<$10K"))))))
If you have Office 365 you can use IFS():
=IFS(N2>100000,">$100K",N2>75000,">75K",N2>50000,">$50K",N2>30000,">$30K",N2>20000,">$20K",N2>10000,">$10K",N2<=10000,"<$10K")

Excel Conditional Formatting based on date range - workdays only

I'm pretty new to Excel, and one of my bosses (who knows even less about Excel than I) is asking me to create a spreadsheet that will track a bunch of different deadlines. For quick reference, I need to use conditional formatting to do the following:
Highlight only non-blank cells that contain a date in the past.
Highlight with a color scale cells containing dates between now and now+90 workdays.
Nothing I've tried is giving me the results I need. I'd appreciate any guidance, as I'm getting very frustrated and this is fairly time-sensitive.
I will answer your second question. I think you will be able to answer the first one yourself from what you learn from the second one.
The executive summary is: use a combination of TODAY() and WORKDAY().
Now for some useful detail.
First, I suspect (from your reputation) that you are new to StackOverflow. Welcome! Take a look on the right side of this page. At the bottom there are "Related" questions. I obtained the following one from there. It is half of the answer to your question. The key point is to use the TODAY() function in your formula.
Second, the WORKDAY() function, with a positive number n, provides a date n workdays into the future. You may also need to make adjustments if your company's calendar is different from the canonical one.
You may want to set a cell in your spreadsheet to the date returned by =WORKDAY(TODAY(),90). Lets just pick A1 for simplicity of explanation. When you first add that formula, you will get what seems like a nonsensical number. Change that cell's format to date and it will make sense.
Now you can refer to A1 in your conditional formatting, as in the "less than" highlighting rule. That should do it.
P.S., while you are at it, search for "named ranges". As a beginner, it is probably the most useful "trick" you could learn. Then name whatever your A1 cell turns out to be something meaningful, like ninetyWorkdaysAhead (you cannot start a named range with a number), then refer to that name in your rule. That way, if you need to move it, your code will not break.

Excel - complex if function

I need help with my Excel table.
I want to compare my Reifenstärke with Reifenstärke, and than compare it with the weather to get the specific round number for that Car.
I need to use a IF-function but i don't really know how,
I will add a picture of my problem
https://www.dropbox.com/sh/7vstay1p15m15y1/AAAF5QHrj4Mf098tpd1I8gIda?dl=0
Use the following VLOOKUP formula under "Minuten pro Runde":
=IF($E26=2,VLOOKUP($F26,$D$17:$I$19,6,FALSE),IF($E26=1,VLOOKUP($F26,$D$17:$I$19,5,FALSE),""))
Then copy it down as far as you need.

Resources