Excel IF function and in between values, but only if - if-statement

I have values for postage, pricing and postage service (only if). I have two choices for postage service (express and eco), price depends on a weight, but service depends on a price (fast service for items over £5, eco - under).
Service: if product price(A2)
<5=eco; >5=express
Service price(C2) by weight(B2):
<=1000gr= £2 eco or £3 express
1001-1250gr= £5 eco or £6 express
1251-5000gr=£9 eco or £11 express
Cells A2 and B2 always display a value, need a formula for C2 to display the price of service calculated by weight, but if item over £5 must display express service price if less - eco.
I have tried:
>IF(AND(OR(B2<=1000),A2<5),2,IF(AND(OR(B2>1000,B2<=1250),A2<5),5,IF(AND(OR(B2>1250,B2<=5000),A2<5),9)))
>IF(AND(OR(B2<=1000),A2<5),2)+IF(AND(OR(B2>=1001,B2<=1250),A2<5),5)+IF(AND(OR(B2>2000),A2<5),9)
Didn't start adding A2>5, because nothing works anyway! Tried many more, but no luck.
Would appreciate any help because stuck and ran out of options :(
Thanks!

There are a couple of ways to accomplish this. The preferred method is to build a small cross-reference table for your surcharges and use the VLOOKUP function to return the values.
However, this question was about hard-coded values in a conditional statement, so I will address that with a LOOKUP function and arrayed constants.
The standard formula in C2 is,
=LOOKUP(B2,{0,1001,1251},{2,5,9})+SIGN(A2)*LOOKUP(B2,{0,1001,1251},{1,1,2})
Fill down as necessary.
In the following image, custom number formats were used on columns A and B ([Color9]\Exp\r\e\s\s - [$£-809]#,##0.00;;[Color10]\Eco - [$£-809]#,##0.00; and 0\g\r_)). Weights >5000 in column B trigger a conditional formatting in column C that displays too heavy.
    

Related

SharePoint Nested IF Statement

I have been working on a calculated Nested If Statement in SharePoint that does not work, if anyone if familiar with SharePoint syntax than please help me, here is the statement, I keep getting errors.
=IF(OR([Is 100% of the Sellers work being performed in an office area, performing administration services (i.e. data entry, developing drawing, monitoring phone calls etc.)?]) = "Yes","Low Risk","High Risk",[Is the Contractor/Seller 100% of the time escorted by a XX Employee or XX Representative for consulting or observation only services (i.e. looking but not touching)?] = "Yes","Low Risk","High Risk")
I assume the long sentence is only the field name, so the formula will be converted to the one below
=IF(OR([A]) = "Yes","Low Risk","High Risk",[B] = "Yes","Low Risk","High Risk")
The issue seems to be the or part as the syntax of OR function is
OR(logical1,logical2,...),Returns Yes if any argument is TRUE; returns
No if all arguments are FALSE.
I assume you want to make the field work like Either A or B field value is "Yes", the outcome is Low Risk, or it will be High Risk.
So the formula shall be like =IF(OR([A]= "Yes",[B] = "Yes"),"Low Risk","High Risk")
Replace the actual name with A, B, the formula finally will be
=IF(OR([Is 100% of the Sellers work being performed in an office area, performing administration services (i.e. data entry, developing drawing, monitoring phone calls etc.)?]= "Yes",[Is the Contractor/Seller 100% of the time escorted by a XX Employee or XX Representative for consulting or observation only services (i.e. looking but not touching)?] = "Yes"),"Low Risk","High Risk")

How to specify the currency for GoogleFinance historical data

I'm having a problem using Google Finance historical data. I need to know the price a particular stock had on a particular date (Usually within the last month).
The problem is, when I use a URL such as https://finance.google.com/finance/historical?q=abx I get different results depending on where I issue the query from.
At home I'm in Argentina and my production server is in the US... when I run the query locally I get the prices in AR$, but when run from the server I get USD (Which is what I actually need).
I tried using a X-Forwared-For header but didn't make a difference...
Ideally I'd like to send an extra parameter (something like cur=USD) to explicitly ask for USD... is there such a thing?
Thanks
I use, currency conversion along with the price of the stock.
For Example:
Price of ABB Ltd in SEK = GOOGLEFINANCE("ABB","price") * GOOGLEFINANCE(("CURRENCY:USDSEK"))
Then I format the cells, rows, columns with prices to local currency(i.e. SEK) as mentioned in the link: Format Numbers in excel.
You could add other parameters such as date as mentioned in below link:
Get exchange rate on a specific date from GoogleFinance

Using an element in a data set to drive If/Then logic decision

I'm working with our IT group to develop an optimizer for logistics operations. The basic design is that it will look at shipments, run a search for additional shipments originating with in XX miles of the previous shipments destination, and link them together in a loop. It will continue to do this until it hits a user defined set of shipment legs where the loop ends at or close to 1st shipment origin.
The issue we are facing is that the materials we ship are chemicals, which can have interactions if placed in a tank that contained XX chemical before it. The obvious solution is to use a different tank or wash it out, but we also need it to compute solutions prior to that.
My problem is, currently, there is no way on the market to do that prior product optimization.
The question is: Is there some kind of logic table function I can write that will allow the optimizer to see an element in the data set (say, Product Family of 1) that will pull from a product database containing predefined product families (i.e. PF 1 = Chemicals A1-B7, PF 2 = Chemical B8-J8, etc.) and then ping off of a logic table that defines a do not ship with list (i.e. PF 1 cannot ship if PF 2 was on the previous leg.

No Shipping Options Available - OpenCart 1.5.6

I'm attempting to set up an OpenCart store for a client.
I'm getting the following error on the shipping page.
"Warning: No Shipping options are available. Please contact us for assistance!"
Research suggests that this error happens when there is a mismatch between the weight-class for the store and for the plugin, or something similar.
I've tried every combination of configuration settings that I can think of without result.
I'm not familiar enough with OpenCart to debug this issue. Where do I need to start looking?
Firstly you have to enable the shipping status and the values from admin panel shipping tab.After that you can get it in the front end.
My troubleshooting procedure:
The store weight UOM had been set to ounces.
The Fedex plugin doesn't support ounces as a weight UOM.
Nothing works.
The store weight UOM was changed to LBS.
Nothing works.
The package size was set to FedEx 10 KG Box
The Fedex plugin can't convert from Lbs to KG on the fly.
The package size was changed to "Fedex Box", without a weight class
Some products now working, all shipping estimates are WAY high.
When changing the default UOM for the store, no existing weights are converted in to the new units, although any weights stored without a unit are now read as being in the new unit.
This meant that the fedex system was trying to pull prices for items that "weighed" hundred of ounces (which it should have been able to do, even though those weights were incorrect.)
I updated the weights on all products to be in line with their unit of measure
At this point, the plugin was working for most, but not all, products, with reasonable accuracy.
I changed the plugin settings from List Rate to Account rate.
Now everything works.
To simplify - The fedex shipping plugin in opencart 1.5.6 will only work if:
All the products in the system have their weights stored in the same UOM.
That UOM is either pounds or kilograms (not ounces!)
A geozone is set, and a zip code is supplied(zip codes are important!)
The package size matches the unit of measure for the weight (no mixing kilograms and pounds!)
The product weights are actually correct
The account in question has a rate for a package of the indicated size
Hopefully someone else will find this helpful.
Ive been through this problem as well and I haven't yet fixed it completely.
But in my particular problem, I had a syntax error in the XML retrieved by the Fedex server after the cURL request.
Printing the $response variable I could find some good hints about some of the problems, for example, commas (,) instead of dots (.) to refer to decimal numbers and decimal numbers where it was expecting an integer.
So var_dump($response) could help some people find their specific issues.

COUNTIF ? I need to count dates, but only once

I have a sheet that has become complex, it has a lot of filters and I need to populate a table with data. I am counting how many times a month we run a product. If we run it once a day, or more, I want to only count that as one.
Date Product Grizzly
1/1 2.5 open
1/1 1.5 closed
1/1 2.5 closed
1/1 2.5 open
Something a little more elaborate than this, but what I need is to count this as one day of 2.5 grizzly closed, instead of two.
Any help? I feel like there is something simple I am missing but cant put my thumb on it and I have spent well over 15 hours working on this.
As found on the following link:
Link to Answer
Try using the DCOUNTA function within Excel.
Although I'm also sure that you could use a pivot chart to provide the same outcome.
EDIT:
I am assuming you are starting with data like the following:
I then created the following table which you can extend to comply with you total data value. For example, you can add extra dates and products.:
The table is populated using a COUNTIFS function.
=COUNTIFS("DateRange",DateCriteria, "ProductRange", ProductCriteria, "GrizzlyRange", GrizzlyCriteria)
So in my table the formula looks like this but the cell references will obviously changes according to your spreadsheet (I used absolute references to make it easier to use the fill handle to copy the formula down:
=COUNTIFS($A:$A,$E4,$B:$B,$F$3,$C:$C,$F$2)
I next nestled this formula in to an IF statement and applied a conditional formatting to end up with the following:
So the formula for each of the cells is now:
=IF("OriginalFormula),"Yes","No")
Example of my 01/01/2015, 1.5 open value:
=IF(COUNTIFS($A:$A,$E4,$B:$B,$F$3,$C:$C,$F$2),"Yes","No")
BUT - You can change the "Yes" and "No" to "1" and "0" if you want to stick with numerical values.