I am trying to develop the formula in excel to look up multiple criteria. Specifically, how do I pull in a value for apples in NYC for location (B)?
Northeast NYC
(A) (B) (C) (D) (A) (B) (C) (D)
Grapes 3,000 2,073 751 2,000 4,253 3,500 1,832 2,500
Apples 400 3,076 2,298 900 27,250 19,000 14,250 9,000
Oranges 6.0 3.1 3.9 5.0 28.4 20.0 13.8 10.0
I have gotten the following formula to work with your data with one minor issue, you will need to fill the header columns (Northeast/NYC) to allow the match to work
=VLOOKUP(A9,A1:I5,MATCH((B9&C9),(A1:I1&A2:I2),0),FALSE)
**NB: Because the formula is using an array function you will need to execute it using the Crl-Shift-Enter command :)
here is a screenshot to let you decipher the references :)
I hope this is helpful
Related
e.g. There are 300 apples. There are 100 people. Each person has a preset value (represented as a number 1 to 5). 1=1 apple, if their value is 5 they get 5 apples etc. But there are 300 apples available so each person is going to get more then the value says they "deserve". Or one day there are only 200 apples and every one gets less then what the value states says they "deserve". Is this possible in excel?
NAME VALUE
john 5
james 5
sam 4
matt 5
mike 3
steve 2
etc...
This absolutely sounds like a perfect problem for Solver to handle. As you know, this in included within Excel's addins. It can deal with all the variables you mentioned.
I'm fairly new to Access, but have most of the basics down because I've used Excel for years. I'm trying to do a DLookup on a table. It's a really large table.
My DLookup is returning blank. It's not giving me an error message or returning "null." It's just blank. I'm searching a text field to return a numerical value. I'm using this below:
Results: DLookUp("[Meas]","[Database]","[Description]='" & [Description] & "'")
The table looks similiar to below:
Description Weight(g) Measure Protein(g)Per Measure Cholesterol(mg)Per Measure
Butter, salted 5 1.0 pat (1" sq, 1/3" high) 0.04 11
Butter, whipped, with salt 3.8 1.0 pat (1" sq, 1/3" high) 0.03 8
Butter oil, anhydrous 12.8 1.0 tbsp 0.04 33
Cheese, blue 28.35 1.0 oz 6.07 21
Cheese, brick 132 1.0 cup, diced 30.68 124
Cheese, brie 28.35 1.0 oz 5.88 28
Any idea what could be causing this? Or do I need to try to put this in VBA?
From the example code you provided, the only issue I'm seeing is that there's a column called Measure in the table, but you are selecting Meas in your DLookup.
Another thing you could try is: creating a new query in Access, switch to SQL View, paste the following SQL and try to execute the query:
select [Meas] from [Database] where [Description]='whatever'"
(this is the SQL equivalent to your DLookup statement)
Does it run without errors?
If yes, does it return any rows?
If neither of this does help, you need to provide more information.
For a start, I'd like to see the exact column names and the exact DLookup statement.
I'm not sure whether you gave us the real data, because you said "The table looks similiar to below". Similar is not enough here!
I have some ranked data that looks something like this in an excel spreadsheet.
1.3
1.3
1.3
1.4
1.6
1.6
1.7
1.8
1.9
2
2
2.3
2.3
2.3
2.4
2.7
3.1
3.3
3.3
3.4
3.4
4
4.2
4.5
4.7
4.9
5.8
6.1
6.7
I'm looking to make a calculator for the Mann-Whitney U-test and for that I need to rank these samples, simple enough using the =RANK() function in Excel, but I need to settle ties in the ranks for the test. The Mann-Whitney method involves taking the average of the ranks. For example, my first 3 values are 1.3 so I need excel to assign all 3 of these values the rank of (1+2+3)/3 (=2). At the moment the =RANK() function just ranks all 3 as 1.
I've seen some similar questions here solved using the IF command but have had trouble appling them to my data.
Any help would be greatley appreciated.
Thanks,
Sam
Which version of Excel are you using? If you have Excel 2010 or later then there is a specific function for this, RANK.AVG, e.g. if your data is in A2:A30 use this formula in B2 copied down to rank as required
=RANK.AVG(A2,A$2:A$30,1)
In earlier versions of Excel you can use this formula to give you the same results
=RANK(A2,A$2:A$30,1)+(COUNTIF(A$2:A$30,A2)-1)/2
You can cheat a little to get duplicates with different ranks. You will need a helper column
I'm going to assume the list of numbers starts # A1...
in B1, enter the formula =A1+ROW()/10000 - this will add on a small amount to the number - not enough to put it into the next value, but enough to distinguish between values
In C1, enter the formula =RANK(B1,$B$1:$B$29,1) to get the new rankings, with no duplicates.
Then copy B1 & C1 down to complete the table. You can hide column B if you don't want the intermediate cells shown
I will try and explain as best I can what i am trying to do but I am no Excel genius :-)
I have 1 Excel Sheet which we will call Template this is going to be pre-populated with data and then used offline, I am going to import a Data Set in to a tab called RawData from SQL Server, data set will be something similar to this
Description Rate Hours SellValue Item
APU 2.50 3 7.50 1
APU 2.50 4 10.00 2
APU 2.50 5 12.50 3
INS 2.50 3 7.50 1
INS 2.50 4 10.00 2
INS 2.50 5 12.50 3
There could be more or less records but no more than 7 distinct descriptions.
There is now another Tab called Report
At Position A1 will be the Title APU then underneath that I want the records with the Description APU to appear and this block will shrink and expand depending on the number of records. Then wherever the last record appears will be the next heading INS and the records associated with that description. There is one final tab called Rate and at position A1 will be a rate value, when this is changed, it will take the new rate value and re-calculate the SaleValue in RawData thus amending the figures in the Report. I am sure there are better ways to explain this but I hope someone has got the gist before I loose what hair I have left.
Thanks in advance
The easiest and powerful approach to such problems would be to use Pivot-Tables in excel. You can customize your data view better.
I'm not the best with technical descriptions but please bear with me.
The task before me:
A large spreadsheet with a column of values that need to be reviewed and a different number input beside them. Unfortunately the number is not simply "value, less 15% though it's close". I will need to have a list of specific "find/replace" commands for my formula.
Example:
3.02
6.65
1.54
3.02
And I need to format it such that it says:
3.02 2.80
6.65 5.60
1.54 1.40
3.02 2.80
My idea was something along the lines of =if(A1=3.02,2.80,=if(A1=6.65,5.60,=if(A1....
Then I'd be able to just paste this formula and drag down the entire spreadsheet.
Unfortunately that didn't work and so I come to you all for help.
Please save me tons of time and figure out how I can make this spreadsheet generate it's own values!
Thanks,
Mike
I would make a little lookup table of the specific replacements:
A B
1 lookup result
2 3.02 2.8
3 6.65 5.6
4 1.54 1.4
5 3.02 2.8
And then you could set up a formula like this:
9 value result
10 3.02 =VLOOKUP(A10,A$2:B$5,2,FALSE)
11 6.65
12 1.54
13 3.02
14 1.54
And you can drag that formula down the rest of the table.
Beware of the A$2:B$5 - if your lookup table is differently-sized, it will need to change.
OR, to keep more along the lines of what you have, try a formula like this:
=if(A1=3.02,2.80,if(A1=6.65,5.60,if(A1....
The change I made was to remove the extra = before the inner IF function calls.
It is hard to guess how many different value do you have. Based on your given sample data you can use XLOOKUP() function like below if you have Excel-365.
=XLOOKUP(A1,{5.6,2.8,1.4},{5.6,2.8,1.4},"",-1)