Need proper formula to obtain correct value - excel

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.

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

Subtracting times across a day in excel

I am working on the capstone project in of the Google Career Certificate in Data Analytics. I am using Microsoft Excel. I have to calculate the ride length based on the start and end ride times. I've inputted the formula =F2(end time)-D2(start time) which returns the ride length. Going through my entire list I have some areas where the start time is like 11pm and the end time is 1am and this is returning ###### because it is a negative number with the regular formula. I've found a modified formula that can kind of do the conversion I am looking for but it is still a bit problematic. The modified formula is =(F2-D2+(F2<D2))*24 and it seems to give an accurate ride length if I reformat the answer to number. The issue is the rest of my data is in time format and the modified ones are in number format. If I convert the number values to time, the ride length values are inaccurate.
It is tricky to make the numeric value change as well due to me using a formula. I can correct them one by one after I save Excel and it no longer stores the numbers as the formula, but there are lots of data points to change and that would be time consuming. I'm hoping to find a more concise way to solve this problem. Maybe with a better formula.
[Snippet of the chart 1
Just like everything in life, there are multiple ways to achieve things. I would have formatted the date and time into a single cell; but. if you're gathering the data from another source, that's understandable.
A simple IF statement here will work. IF the days are one apart, then take '1' day off the starting time, else do your original formula:
=IF(E4-C4=1,F4-(D4-1),F4-D4)

Calculating Multiple Averages

It's my first time posting a question to this forum. Though I have found answers here many times before, I have been unable to find a solution to my current predicament.
I work in a call center and each week I need to analyze data from the thousands of call that took place over the week. I'm new to programming in Excel-VBA but I've been able to get pretty far.
The data is produced by a third party program and the format is nigh unreadable. Much of the programming I've done so far has been geared towards making the data more organized. Now, I'd like to get into more analysis.
The data is arranged by employee number (NOT in order, though). Each employee takes several calls over the course of the week, some for which the customer takes a survey. It's the survey scores I want. I want to take the average of all the surveys for each employee and then display that average in the same row as each of the entries.
Example
The yellow highlighted area is what I want to add. Any ideas? Thanks for any help in advance!
No need for VBA. If you have the supported version of Excel you can use AVERAGEIF. If not you can use below formula.
Enter as an array formula by pressing Ctrl+Shift+Enter when exiting cell edit mode (instead of just enter).
=AVERAGE(IF($A$2:$A$13=A2,$B$2:$B$13))
Then copy down for all rows.

Calculating Business Days in Excel/Indirect Reference

I'm working on making a spreadsheet where someone can put in a date they want a final product by, and then it will automatically fill out deadlines for different steps along the way. (i.e.) If you want something by June 22, Step C would need to be done x business days prior, Step B would need to be done y business days prior to that, and Step A z business days prior to that.
This definitely isn't the best way to do it but I think it should be okay for now because this is only needed for a finite time, I wrote out a list of all the business days in the relevant time frame. I want to make it so when someone types in the day they need the final product, the dates before it fill out just by inputting the cell x cells before the final date, etc.
If there's a better/easier way to do this I'm all ears. This is just what I was thinking as someone with not all that much Excel experience who just needs to make this functional, not perfect.

Converting TEXT that represents NEGATIVE TIME value to a number or time value for adding (Excel)

I've got a spreadsheet (Office 2007 version of Excel) full of text entries that are negative time values, example "-0:07" as in an employee took 7 mins less to complete a job than expected. I need to perform mathematical calculations on these entries and am looking for a more elegant formula/method than I've come up with so far.
I know about 1904 date system and * or / by 24 to convert back and forth, the problem is getting a formula that will recognize the text entry as a negative time value.
I've tried value(), *1, which both work on the text fields if the number is positive, but the "-" seems to mess those up. Even paste-special/add fails to recognize these as numbers.
Here's what I came up with that gets the job done, but it's just so ugly to me:
=IF(LEFT(E5,1)="-",((VALUE(RIGHT(E5,LEN(E5)-1)))*-1.0),VALUE(E5))
Obviously my text entry is in cell E5 in this example.
This works, so I'm not desperate for a solution, but for educational purposes (and smaller code) I'd like to know if there's a better way to this. Does anyone have a suggestion for something shorter, easier?
Thanks.
P.S. - an interesting tidbit here, I use Excel at work, but not at home, so I uploaded a sample spreadsheet to Google Docs, and it actually handles the Value() command on those entries properly. Weird, huh?
Thanks again for any suggestions.
Excel doesn't handle time spans in cells. It only deals with time. When you do "00:07" it is then converted to 0.0048611 which is the same as Jan 1st 1900 12.07 am. So if you did 2 minutes minus 7 minutes it would give at best 11.55pm.
The way you do it is the only way.

Resources