Skip to main content
deleted 1 character in body; edited tags; edited title
Source Link
pnuts
  • 17.8k
  • 5
  • 54
  • 103

How do I accomplish a vlookupVLOOKUP if my key range is discontinuous?

So, I've got a chart (an EXP chart for an RPG) with several break points in it. One column is how many EXP is required to get to a level, the other column is what level you get to be given that EXP total.

  Like this:

  EXP | Level
---------------
    0 | 1
2,000 | 2
4,000 | 3
9,000 | 4

Andand it goes up to level 36, but you get the idea. The EXP required does not follow a formula (sadly).

Now, I want the player to type into one box how many EXP they have, and then I want another box to reference the chart and compute their current level. I know that I could do it using a long chain of if statements, but it seems like there should be a better way of doing it. 

What is that better way?

How do I accomplish a vlookup if my key range is discontinuous?

So, I've got a chart (an EXP chart for an RPG) with several break points in it. One column is how many EXP is required to get to a level, the other column is what level you get to be given that EXP total.

  Like this:

  EXP | Level
---------------
    0 | 1
2,000 | 2
4,000 | 3
9,000 | 4

And it goes up to level 36, but you get the idea. The EXP required does not follow a formula (sadly).

Now, I want the player to type into one box how many EXP they have, and then I want another box to reference the chart and compute their current level. I know that I could do it using a long chain of if statements, but it seems like there should be a better way of doing it. What is that better way?

How do I accomplish a VLOOKUP if my key range is discontinuous?

So, I've got a chart (an EXP chart for an RPG) with several break points in it. One column is how many EXP is required to get to a level, the other column is what level you get to be given that EXP total. Like this:

  EXP | Level
---------------
    0 | 1
2,000 | 2
4,000 | 3
9,000 | 4

and it goes up to level 36, but you get the idea. The EXP required does not follow a formula (sadly).

Now, I want the player to type into one box how many EXP they have, and then I want another box to reference the chart and compute their current level. I know that I could do it using a long chain of if statements, but it seems like there should be a better way of doing it. 

What is that better way?

Source Link

How do I accomplish a vlookup if my key range is discontinuous?

So, I've got a chart (an EXP chart for an RPG) with several break points in it. One column is how many EXP is required to get to a level, the other column is what level you get to be given that EXP total.

Like this:

  EXP | Level
---------------
    0 | 1
2,000 | 2
4,000 | 3
9,000 | 4

And it goes up to level 36, but you get the idea. The EXP required does not follow a formula (sadly).

Now, I want the player to type into one box how many EXP they have, and then I want another box to reference the chart and compute their current level. I know that I could do it using a long chain of if statements, but it seems like there should be a better way of doing it. What is that better way?