Excel- Need to ignore "±" and sometimes a "°" in a larger function - excel

I have a series of spreadsheets that list design drawing dimensions. A1 is a number corresponding to a drawing, B1 is the dimension on the drawing, C1 is the actual dimension we encountered, D1 is the manufacturing error tolerance which is something like ±.005 or ± 1°. They vary between a few numbers on each drawing, and the drawings vary. E1 is a column that needs to say either Accept or Reject, reject is when the B1 dimension is more than the D1 away from the C1 value.
I inherited the spreadsheet with the function =IF(AND(C1<=(B1+.005), C1>=(B1-.005)), "Accept", "Reject"). This works, but I need to keep changing the .005 to values like .020 and 1° and I want to finish this faster than doing it all by hand. I would like to be able to drag in down the whole E column and have it fill out accept and reject accordingly.
I tried changing it (C1<=(B1+D1)) so it pulls from the tolerance, but get a value error because every tolerance has a ± in front of it. I tried adding MID to it, but I keep getting errors because I'm not quite sure how to incorporate it.
I couldn't find other help online because most people using MID are trying to extract characters, but I need the tolerances to stay the same in the D column. Avoiding errors from "°" would also be helpful, but that's only about 5% of the data and I deal with doing those manually if I have to. Kinda new to excel, still trying to really understand the intricacies and necessary syntax of the functions, so sorry if this is and easy one.
For the Mid I tried C1<=(B1+(MID(D1,2,4))) Which I know is very wrong. Thanks for any and all help!

Taking your approach:
=IF(AND(C1<=(B1+MID(SUBSTITUTE(D1,"°",""),2,LEN(D1))),C1>=(B1-MID(SUBSTITUTE(D1,"°",""),2,LEN(D1)))),"Accept","Reject")

Thanks pnuts
=IF(AND(C1<=(B1+MID(SUBSTITUTE(D1,"°",""),2,LEN(D1))),C1>=(B1-MID(SUBSTITUTE(D1,"°",""),2,LEN(D1)))),"Accept","Reject

Related

Using IF with ROUNDDOWN, To Calculate How Many Times For A Process

I apologize if the title is a bit vague. I am trying to create a calculator that takes into account how much "scrap" I have, how much is needed to resmelt it, and how many bars recieved.
Currently using:
(=if((amtOwned/qtyToSmelt)<1,,rounddown((amtOwned/qtyToSmelt)*barsMade))
Table and Formula
The problem I am having is you MUST have the QTY to Smelt. But the value returned includes partial quantities.
Ex. 125 Bottle Caps should equal 4 Bars total. Yet it returns 5.
How can i make the formula only account for increments of the bars recieved?
Thank you for any help, again i apologize if this isn't that clear. Im not exactly sure how to express my need in this situation.
I have tried messing around with the syntax and where every argument sits, even this formula is the most recent iteration of what i thought would be needed.
EDIT: I have tried using the TRUNC function and this seems to be working as I need it to. The formula now is:
=TRUNC((AMTowned/AMTneeded),0)*barsRecieved
=TRUNC((136/50),0)*2 This is returning 2 bars instead of 3. Which is exactly what I need.
It appears this is working by truncating the number first then multiplying it. So, 1.5 becomes 1 before being multiplied. This was my guess after doing more research. I had been searching for a while before I posted this but am glad to have learned what I have in searching for this.
There is a tool for auditing formulas. To see it go to Formulas > Evaluate Formula.
So here is you formula =IF((E3/C3)<1,,ROUNDDOWN((E3/C3)*D3,0))
Have you tried the calculation on your regular calculator? To me it is doing what you would expect. (125/50)*2 = 5

Add Values until Threshold is reached, then go to next Threshold

I would need to add up values from D11 and downwards so that once the threshold in column E is reached, the remainder is assigned to the next threshold (so, once bucket A -E3- is filled, it goes on the next). As per below example, in D14 1 euro is assigned to Sector A and the other 32 to B. To reach the following threshold in E4 18 euros are needed, so that amount would be written in D15.
I tried with (in D11) =IF(SUM(OFFSET(C11,,,,1,1))<=E3,C11,E3-C11) to start, thinking I could somehow find a way to count the height of the range, but I am stuck. Maybe a Macro would be a better option? If so, could someone guide me on how to start?
[EDIT] Although I have received a perfectly working answer, I tried to continue with the logic I was using above, yet there is the need of one help column and a number of references that gives headache, plus, it still needs more work. Simple is better!
I would keep things simple with a pull-down/pull across formula like this:
=MIN($C12-SUM($D12:D12),E$10-SUM(E11:E$11))
Can split across multiple sectors if required:

Need proper formula to obtain correct value

It's my first question here. I need a formula which take the correct code at specific date. After taking correct code, excel table is using it for calculation of the correct value.
The concept is a little complicated. There is a calendar which is starting at 15.09.2021 (V3 Cell) and ending at 04.06.2022(JX3 Cell). And our codes are: ITB, OR, TBE, CBE, PO, VDR, SMF, FMF and DS. All of them are the steps of procurement process. And each of them has a specific values/coefficients like 0.1, 0.2, 0.15 etc and everyone comes true at specific date. And their locations are L2 to T2.
For example, we are taking the codes for procurement of generator at 15 September 2021:
=IF(V$3=$L5;$L$2;IF(V$3=$M5;$M$2;IF(V$3=$N5;$N$2;IF(V$3=$O5;$O$2;IF(V$3=$P5;$P$2;IF(V$3=$T5;$T$2;IF(V$3=$S5;$S$2;IF(V$3=$R5;$R$2;IF(V$3=$Q5;$Q$2;0)))))))))
L5 to T5 are the dates of procurement steps of that item.
And we are using same formula for other dates. It is working. But when, for example TBE and CBE completed at the same day, excel takes one of them (which is first). Sometimes 4-5 steps are completing at the same day. And for this situation, we can not take the true value of the item's procurement. We are calculating the progress of the procurement in that way. But as I said, it isn't working for the same dates. I tried to fix the formula by putting all possible combinations and giving them new code and coeffient:
=IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5;V$3=T5);$U$117;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5);$U$118;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5);$U$119;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$120;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5;V$3=P5);$U$121;IF(AND(V$3=L5;V$3=M5;V$3=N5;V$3=O5);$U$122;IF(AND(V$3=L5;V$3=M5;V$3=N5);$U$123;IF(AND(V$3=L5;V$3=M5);$U$124;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5;V$3=T5);$U$125;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5;V$3=S5);$U$126;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=R5);$U$127;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$128;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$129;IF(AND(V$3=M5;V$3=N5;V$3=O5;V$3=P5);$U$130;IF(AND(V$3=M5;V$3=N5;V$3=O5);$U$131;IF(AND(V$3=R5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=S5;V$3=T5);$U$132;IF(AND(V$3=R5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5;V$3=S5);$U$133;IF(AND(V$3=R5;V$3=N5;V$3=O5;V$3=P5;V$3=Q5);$U$134;IF(AND(V$3=N5;V$3=O5;V$3=P5);$U$136;IF(V$3=$L5;$L$2;IF(V$3=$M5;$M$2;IF(V$3=$N5;$N$2;IF(V$3=$O5;$O$2;IF(V$3=$P5;$P$2;IF(V$3=$T5;$T$2;IF(V$3=$S5;$S$2;IF(V$3=$R5;$R$2;IF(V$3=$Q5;$Q$2;0))))))))))))))))))))))))))))
New codes are at U117 to u152.
As it can be seen, it is so rough method to use. I tried to put every possible combination but also there is a character limit and i can't write all of them too.
I hope I could explain the problem well. Maybe it can be solved by VBA too.
I'll be glad if anyone helps for practical methods. Thanks.

Removing Lower/Upper Fence of outliers from input data to then be evaluated

What I have attempted:
AVERAGEIF(B11:V11,">+MEDIAN(B11:V11)")
What I am trying to do:
I would like to take the average of the upper half of given data. Elaborating more. I would like to find a formula that will allow me to remove a given lower fence of outliers and dissect the data then given to me. I would greatly prefer to maintain this formula within one cell "not grabbing different results from formulas within multiple cells".
Update:
Following through I found the solution.. I think.
One thing I should have explained further:
The data coming in replicating a typical sqrt function.
What I wanted to achieve is to capture the mean of the "plateau" of the data.
The equation I used was:
=AVERAGEIF(B3:B62,(">"&+TRIMMEAN(B3:B62,0.8)),B3:B62)
This was something I just copied and pasted. of course "B3" and "B62" are significant only for my application.
My rough explanation of the equation:
TRIMMEAN will limit the AVERAGE to the top 20%(">")(0.8) of the data selected. So for my application, this SHOULD give me a rough mean of the "plateau" of the data i would like to find the mean for.
This formula calculates the Median() of the range, then AverageIf() uses the median and only grabs values that are greater than or equal to >= the median ~ giving you the average of the 'top-half' of your values.
AVERAGEIF(A1:A10,">="&MEDIAN(A1:A10))
Hope this help!

Interpolating data points in Excel

I'm sure this is the kind of problem other have solved many times before.
A group of people are going to do measurements (Home energy usage to be exact).
All of them will do that at different times and in different intervals.
So what I'll get from each person is a set of {date, value} pairs where there are dates missing in the set.
What I need is a complete set of {date, value} pairs where for each date withing the range a value is known (either measured or calculated).
I expect that a simple linear interpolation would suffice for this project.
If I assume that it must be done in Excel.
What is the best way to interpolate in such a dataset (so I have a value for every day) ?
Thanks.
NOTE: When these datasets are complete I'll determine the slope (i.e. usage per day) and from that we can start doing home-to-home comparisons.
ADDITIONAL INFO After first few suggestions:
I do not want to manually figure out where the holes are in my measurement set (too many incomplete measurement sets!!).
I'm looking for something (existing) automatic to do that for me.
So if my input is
{2009-06-01, 10}
{2009-06-03, 20}
{2009-06-06, 110}
Then I expect to automatically get
{2009-06-01, 10}
{2009-06-02, 15}
{2009-06-03, 20}
{2009-06-04, 50}
{2009-06-05, 80}
{2009-06-06, 110}
Yes, I can write software that does this. I am just hoping that someone already has a "ready to run" software (Excel) feature for this (rather generic) problem.
I came across this and was reluctant to use an add-in because it makes it tough to share the sheet with people who don't have the add-in installed.
My officemate designed a clean formula that is relatively compact (at the expensive of using a bit of magic).
Things to note:
The formula works by:
using the MATCH function to find the row in the inputs range just before the value being searched for (e.g. 3 is the value just before 3.5)
using OFFSETs to select the square of that line and the next (in light purple)
using FORECAST to build a linear interpolation using just those two points, and getting the result
This formula cannot do extrapolations; make sure that your search value is between the endpoints (I do this in the example below by having extreme values).
Not sure if this is too complicated for folks; but it had the benefit of being very portable (and simpler than many alternate solutions).
If you want to copy-paste the formula, it is:
=FORECAST(F3,OFFSET(inputs,MATCH(F3,inputs)-1,1,2,1),OFFSET(inputs,MATCH(F3,inputs)-1,0,2,1
(inputs being a named range)
There are two functions, LINEST and TREND, that you can try to see which gives you the better results. They both take sets of known Xs and Ys along with a new X value, and calculate a new Y value. The difference is that LINEST does a simple linear regression, while TREND will first try to find a curve that fits your data before doing the regression.
The easiest way to do it probably is as follows:
Download Excel add-on here: XlXtrFun™ Extra Functions for Microsoft Excel
Use function intepolate().
=Interpolate($A$1:$A$3,$B$1:$B$3,D1,FALSE,FALSE)
Columns A and B should contain your input, and column G should contain all your date values. Formula goes into the column E.
A nice graphical way to see how well your interpolated results fit:
Take your date,value pairs and graph them using the XY chart in Excel (not the Line chart). Right-click on the resulting line on the graph and click 'Add trendline'. There are lots of different options to choose which type of curve fitting is used. Then you can go to the properties of the newly created trendline and display the equation and the R-squared value.
Make sure that when you format the trendline Equation label, you set the numerical format to have a high degree of precision, so that all of the significant digits of the equation constants are displayed.
The answer above by YGA doesn't handle end of range cases where the desired X value is the same as the reference range's X value. Using the example given by YGA, the excel formula would return #DIV/0! error if an interpolated value at 9999 was asked for. This is obviously part of the reason why YGA added the extreme endpoints of 9999 and -9999 to the input data range, and then assumes that all forecasted values are between these two numbers. If such padding is undesired or not possible, another way to avoid a #DIV/0! error is to check for an exact input value match using the following formula:
=IF(ISNA(MATCH(F3,inputs,0)),FORECAST(F3,OFFSET(inputs,MATCH(F3,inputs)-1,1,2,1),OFFSET(inputs,MATCH(F3,inputs)-1,0,2,1)),OFFSET(inputs,MATCH(F3,inputs)-1,1,1,1))
where F3 is the value where interpolated results are wanted.
Note: I would have just added this as a comment to the original YGA post, but I don't have enough reputation points yet.
alternatively.
=INDEX(yVals,MATCH(J7,xVals,1))+(J7-MATCH(J7,xVals,1))*(INDEX(yVals,MATCH(J7,xVals,1)+1)-INDEX(yVals,MATCH(J7,xVals,1)))/(INDEX(xVals,MATCH(J7,xVals,1)+1)-MATCH(J7,xVals,1))
where j7 is the x value.
xvals is range of x values
yvals is range of y values
easier to put this into code.
You can find out which formula fits best your data, using Excel's "trend line" feature. Using that formula, you can calculate y for any x
Create linear scatter (XY) for it (Insert => Scatter);
Create Polynominal or Moving Average trend line, check "Display Equation on
chart" (right-click on series => Add Trend Line);
Copy the equation into cell and replace x's with your desired x value
On screenshot below A12:A16 holds x's, B12:B16 holds y's, and C12 contains formula that calculates y for any x.
I first posted an answer here, but later found this question

Resources