Excel Formula to Compare Cell to Range then Give Answer - excel

I need a formula to compare one cell to a range and then depending on where the cell falls into the range, tell me how many more of something I need to get the original cell above the next highest number in the range. The range is only 4 numbers that are fixed.
Below is an image to hopefully help visualize what I want. Where it says "You will need at min x more Power..." is where I need the formula to go. I basically want the 'x' to be a number 1-4 depending on how the Power Pool: Available (W) number falls into the range under 15.4W/Port table in the lower left corner.
So right now you can see that I have 3 Switches and the Power Pool Available is only at 1275W. Looking at the table in the bottom left corner you can see that with 3 Switches that number needs to be at least 2328.48W.
Hope I've given enough info and I apologize if there is already an answer somewhere. Thanks in advance!
*Updated with Row and Column identifiers
*Update:
I know what I want in my head, I'm just having a hard time getting it out my fingertips!
Basically I want cell C24 to tell me how many more power supplies i need(either 0,1,2,3, or 4) based on where cell K21 falls into the range E28:E31.
I'm thinking what I might actually need is for line 24 to tell me how many more watts I need vs how many more power supplies. Because in real life, there are a few options of power supplies available.
I've tried a few IF statements but if I change it to how many more watts I need I might actually be able to figure it out.
So with that, since I'm currently using 3 Switches and according to my table at the bottom I would need 2328.48W of power to supply 15.4W of power to each port. Cell K21 is only at 1275W so I want cell C24 to tell me that I need 1053.48 more Watts of Power, at min.
Hope this helps! Thanks again!

Related

Excel: Using an IF() Function with Conditions Depending on Other Cells

I am writing an excel script for my company, and I am getting hung up on something. I have written a formula that calculates pay for a certain benefits we have.
This paragraph explains parts of the spreadsheet that work. If the employee was here for at least a year, they receive their benefit. If not, they are not eligible. I have a column that has a condition for their eligibility using the IF() function and determines whether or not they are eligible by their hire date. I also have a column that says the total pay from their benefit (6 percent of their normal hourly rate multiplied by their hours worked).
The issue I need help with is the last separate column that determines their pay if they are in fact eligible. What I want to do, is if the eligibility is true, have the cell display their benefit pay. If they are not eligible, I want the cell to display 0 (I already have a column saying if they are eligible or not to prevent confusion).
The formula I currently have looks like this:
=IF(V2="Eligible for SWW Pay",=T2,=0)
where V is the eligibility column and T is the pay given from their benefits. The formulas in both T and V give the correct output. However, this formula for the last column gives me an error. I don't know if it is a syntax error or if my logic is totally wrong for doing this.
Does anyone have any idea what I am doing wrong? Any feedback is greatly appreciated!
Thanks,
Nick
I would propose you the following formula:
=IF(V2="Eligible for SWW Pay",T2,0)
The equal-signs in front of T2 and 0 are not needed.

Excel MAX/MIN but only if opposing cell is greater than 0

I've found similar examples through searching but I can't find anything that matches the issue that I have...
I have a table which shows parts received/rejected, I wish to see the maximum days early/late (I'll only need help with one as the other I can then do!)
- but there are dummy orders which I wish to ignore (they show a received/reject of 0).
Here is example data from the 'AnnualDump' sheet:
My current calculation is
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(AnnualDump!$G:$G))
[Column H is Received/Rejected and G is VarianceDays]
This simply looks at if there is any data on the sheet before running the calculation, which is fantastic for 95% of the time... but I want to ignore any values that have a received/rejected of 0...
I want it to show 29, but it's showing 30 in this instance as it's not ignoring 0qty lines.
I've tried adding another IF statement but it didn't work :/
Completely stuck now and not sure what the next step to try is...
I can do it if I cheat (call both columns to another sheet, turn text white, use an 'IF cell greater than x, then value' to compare the whole lot and then min/max that third column) but I'm trying to avoid that!
Any pointers or help will be greatly appreciated (complete VBA noob in excel so I'd like to avoid that if possible).
Thanks
Try this array formula. Confirm with Ctrl, Shift and Enter and curly brackets will appear round the formula.
I would strongly suggest you don't use full column references though as these formulae are rather resource-intensive.
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(IF(AnnualDump!$H:$H>0,AnnualDump!$G:$G)))

Excel - Counting number of phone numbers in range

Cell A2: 5555550000
Cell A3: 5555550003
Trying to find a way to count the number of phone numbers in this range. The cheat way is:
=A3-A2+1
This would give me "4" because the first phone number actually is a value that needs to be calculated. Such is the case with a range like 5550000-5550099 which is 100 numbers, not 99.
Is there a function in excel that actually does the same thing as my cheat formula? I'm in the mood to learn something. Upon searching the internet, I didn't find anything that could help me in this case.
Thanks!
For many small and large blocks Excel can help. With the lower limit of each in ColumnA and the upper in ColumnB (a repeat of the A value where a single number 'range') then summing the two columns (say in Row12) and:
=B12-A12+COUNT(A1:B11)/2
should give the total. This is barely easier than B1-A1+1 - very similar to your approach - and then copying down and summing but may have a slight advantage in that it might be used as a template, where if the totals are in a row with high enough number there will always be empty rows available (and the result always in the same cell). The +1 in the shorter formula would not allow that, though would easily be overcome with:
=IF(A1<>0,B1-A1+1,0)

Dynamically sum row values based on column headers? - Excel

Need solutions for the queries posted in the below link,
http://www.mrexcel.com/forum/excel-questions/334740-dynamically-sum-row-values-based-column-headers.html
Having PersonWeek as separate column with sum of weeks should be displayed.
Quest: Dynamically sum row values based on column headers?
It is good form to re-post the question in its entirety on this site; nevertheless:
What you are looking for is relatively straight forward. There are a lot of ways to accomplish this but I suggest that you use combination of the 'Match' function and the the 'Offset' function. The Offset function creates a range based on a given start point, moving up/down / left/right as indicated, with a given height / width. For example:
=Offset(B2,1,2,3,4)
Indicates the range D3:G5. This is the range given by starting at cell B2, moving 1 row down and 2 columns to the right, and going for a total of 3 rows and 4 columns.
So the remaining point is to determine where to start and stop your offset.
First, the first field in your Offset function will be cell A1, as that is the top-left corner of your data table. To find how many rows to move down, you need to find what project you are referring to (I will assume that cell A6 is where you enter the project name that you care about, A7 is where you enter the first week you care about, and A8 is where you enter the last week you care about). To find how many rows to move down from A1, then, use Match:
=Match(A6, A2:A5,0)
To find how many columns to move to the right to find your first week, use Match again:
=Match(A7, B1:G1,0)
Assuming you only want to look at a single project, we know how high we want the range to be (1).
To find how wide we want the range to be, we need to know your ending week, less your starting week:
=(Match(A8,B1:G1,0)-Match(A7, B1:G1,0))
So the whole thing together will be:
=Offset(A1,Match(A6, A2:A5,0),Match(A7, B1:G1,0),1,Match(A8,B1:G1,0)-Match(A7, B1:G1,0))
Now the only thing left is to wrap the newly defined range in a 'sum' function, like so:
=Sum(Offset(A1,Match(A6, A2:A5,0),Match(A7, B1:G1,0),1,Match(A8,B1:G1,0)-Match(A7, B1:G1,0)))
This formula will create an error if someone enters a project name / weekname in a way that isn't found in your table - so in cells A6-A8 you may want to use data validation to only allow those names to be entered - let me know if you would like elaboration on that.

repeat a specific excel formula pattern down column

I'm not an excel whiz but really stuck on this one and hoping a guru out there will be able to help me out as it's really important for some research I am doing - please!! I think it will be quite a simple fix (see attached example excel sheet for context below). If you are even able to modify the formula in question and re-attach that would be awesome too!!
There are 2 datasets in sheet 1 side-by-side. The data on left (rows A to K) displays data in 10 sec time epochs, the data on right (rows N to X) in 1 min time epochs. I would like to be able to drag the formula in P2 all the way down the column P based on data in column C (as per colour coding in red and blue).
You'll note that the P2 formula is taking a SUM of C2-C7 and P3 is taking sum of C8-C13. I would like to be able to continue this pattern down the column, perhaps with a better drag-down formula (or more efficiently – as there is loads of data!) if possible. Essentially I want each single data row on the right to move onto the next block of 6 rows from data on the left.
I hope I explained that well enough. Really hoping someone can help! Really important to me!
Patrick
See attached excel example - thanks so much!! I will be ever grateful!
https://www.dropbox.com/s/72r7ty9v15vzyyv/drag%20formula%20quick%20way%20-%20help.xlsx?dl=0
Here's one way. In P2 enter:
=SUM(OFFSET(INDEX(C:C,(ROWS($A$1:$A1)-1)*6+2),0,0,6))
and then copy that across and down as required. This is volatile due to the use of OFFSET which shouldn't be a problem with a small data set like this, but if your real data is bigger and you have more formulas, you may prefer:
=SUM(INDEX(C:C,(ROWS($A$1:$A1)-1)*6+2):INDEX(C:C,(ROWS($A$1:$A1)-1)*6+7))
which is only semi-volatile. (i.e. it will recalculate whenever the workbook is opened, even if its inputs haven't changed)

Resources