d2jsp
Log InRegister
d2jsp Forums > d2jsp > General Help > Google Sheets/windows Excel
Add Reply New Topic
Member
Posts: 51,663
Joined: Nov 19 2007
Gold: 5.00
Oct 9 2015 03:40pm
https://docs.google.com/spreadsheets/d/1H8CUHHc5e1VF9XPC0X1uBf3jrrqR-JybRxy2lF3lP0M/edit#gid=0

I want to make words have values.
Say if I type gold ore into d5, I want it to auto type in e5 the amount it's worth via the market price in cell I16


I tried the "If" option
=IF(or(d5="Rune pickaxe",d5="Diamond bolt(e)"), "20,282","42,500")
That works for 2 items, but I want to add all the items to that on the F2:F33
I tried it with 3 items
=IF(OR(C1="Rune pickaxe",C1="Diamond bolt(e)",C1="Rune 2h sword"), "20,282","42,500","40,124")
but there's too many arguments, and I'm unsure if/or you can have more than 2 or not.
Member
Posts: 65,716
Joined: May 15 2007
Gold: 5,000.66
Oct 9 2015 06:21pm
I've been looking into this. You might need one more outer paranthesis next to OR and the end of the test condition.

Look here

https://www.ablebits.com/office-addins-blog/2014/12/03/excel-if-function-iferrror-ifna/
Retired Moderator
Posts: 7,245
Joined: Jul 29 2004
Gold: 0.00
Trader: Trusted
Oct 9 2015 08:23pm
you need another OR with () for three equations
Retired Moderator
Posts: 7,245
Joined: Jul 29 2004
Gold: 0.00
Trader: Trusted
Oct 9 2015 08:58pm
Edit sorry I was wrong, read it wrong.

If you want to run more than 2 options, don't run the OR option at all, use must IF statements

=IF(C1="Rune pickaxe","20,282",(IF(C1="Diamond bolt(e)","42,500",IF(C1="Rune 2h sword","40,124"))))

This post was edited by Jeffry on Oct 9 2015 09:04pm
Member
Posts: 51,663
Joined: Nov 19 2007
Gold: 5.00
Oct 9 2015 10:27pm
Quote (Jeffry @ Oct 9 2015 08:58pm)
Edit sorry I was wrong, read it wrong.

If you want to run more than 2 options, don't run the OR option at all, use must IF statements

=IF(C1="Rune pickaxe","20,282",(IF(C1="Diamond bolt(e)","42,500",IF(C1="Rune 2h sword","40,124"))))


Thanks bud
Member
Posts: 10,654
Joined: Jan 18 2007
Gold: 6,205.82
Trader: Trusted
Oct 10 2015 12:47pm
If I understand it correctly, you want to find a certain item drop (typed out in D5 for example) on the right, and get its value.
So if you type "Gold ore" in D5, you find the value of Gold ore on the right, which would be 93,900, if you type in "Yew seed", you would get 82,139.
If that is what you want to achieve, there is a much easier way than typing 32 IF statements, and it's the VLOOKUP function (vertical lookup).
If you just want the solution, the formula for you will be at the end of my post, but I'll try to explain what it does first.

Basically you specify a range of cells, VLOOKUP takes the first column of it, finds the first row in which a key you specified (word/number/anything) occurs, then returns the cell found in the nth column of that row, where you specify what n is.
This is what the function you have to put in the cell into which you want to get the returned value looks like: =VLOOKUP(what_to_look_for, where_to_look_for_it, which_column_it_is_in, is_the_list_sorted)
VLOOKUP searches for what_to_look_for in the first column of the specified where_to_look_for_it range, and returns the value found in column which_column_it_is_in of the row in which it found what_to_look_for.
The is_the_list_sorted is true if you are using a sorted list, but it will have to be false here.

Here's an example:


We have some data in cells A1 through C3, with some fruits in the first column, their colors in the second one, and some random values in the third one.
We want to get the random values, so we use the =VLOOKUP function as seen in the picture.

what_to_look_for: "apple"
where_to_look_for_it: A1:C3 (and we make the references absolute since those cells are not going to change positions, so $A$1:$C$3, you can just press F4 if you have the cursor in it and Google Sheets will do it for you)
which_columns_it_is_in: 3 (third column has the values we want to get)
is_the_list_sorted: FALSE (because it isn't)

And the result we get is 3, since that's the value in its row.

Of course you don't have to manually type in "apple" or "orange" into the function, you can make it reference another cell, thus making it easily copy-able:


Note that the A6, A7, etc. doesn't have $s, so you can copy them and they will change accordingly.

______________

Now to use it in your sheets (if the name of what you want to look up is in D5, put this function into E5):
=VLOOKUP(D5,$F$2:$I$33, 4, FALSE)

Note: you need to type the item drop name the same way it is found on the right, for example if you type "Limpwurt roots", it won't find anything, because on the right it's "Limpwurt root" (without the plural). So you need to be exact for it to work.

If you have any questions feel free to PM me! :)
Member
Posts: 2
Joined: Oct 14 2015
Gold: 0.00
Oct 14 2015 04:16am
I'll agree on "Jeffry" on that..
Multiple If Statements will do the trick for you for sure..

This post was edited by customcutmirror on Oct 14 2015 04:17am
Go Back To General Help Topic List
Add Reply New Topic