Solved

Add a new value based on adjacent value

Posted on 2014-12-22
3
67 Views
Last Modified: 2015-01-05
The lookup values are cube numbers produced by checking against other values in the spreadsheet and are part of one of the following 4 groups (A1, A2, A3, A4) where A represents an area and C represents a cube number.

C1-C280 - member of area 4
C282-C448 - member of area 3
C454-C648 - member of area 2
C659-C894 - member of area 1

The lookup values (cube numbers) are in column W, and I need area numbers to fill for column V once a cube number exists in column W.  If a cube number does not yet exist in column W, then I want for nothing to occur in column V.

Assistance is greatly appreciated.
0
Comment
Question by:frugalmule
  • 2
3 Comments
 
LVL 10

Assisted Solution

by:Ray
Ray earned 166 total points
ID: 40513228
Will the values in Column W be a number (such as: 282 or 648 etc) or will it contain a 'C' plus a number?  
And you then want a number (1,2,3 or 4) in Column V (blank if nothing in W)?
0
 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 334 total points
ID: 40513324
I presume that cube numbers are listed as "C###" and you want the area values returned as A1-A4.  Because the area numbers are grouped by sequential sets of cube numbers you can use a lookup function to resolve this.

1) Set up a lookup table (on another sheet, ideally).  In one column you'll have a cube numbers, but only the starting numbers for each area.  In the second column you'll show the appropriate area number.  Like so:
cube lookup
Note that I've also included an "error" result in case a cube value is found exceeding the area definitions.

2) In column V you'll insert a lookup formula like so (note the sheet name where I put the lookup table from the above step is titled "Lookups"
=VLOOKUP(VALUE(MID(W2,2,10)),Lookups!$A$2:$B$6,2,TRUE)

This is looking at the numerical value of the cube (after the "C") and returning the ordered/sorted result in the lookup table.

See the example workbook.  It randomly generates cube numbers so you can see the results change.

Regards,
-Glenn
EE-Q28585336.xlsx
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 334 total points
ID: 40514323
I just realized that your area definitions have some gaps in the cube numbers, so I've updated the lookup table to handle that.  If a Cube number appears between valid area definitions (ex., C650), the word "Invalid" will display.  See attached revised example file.

-Glenn
EE-Q28585336.xlsx
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Checkout file from sharepoint server with password 2 39
Excel Calculation 4 46
EXCEL formula that pulls formatting as well 12 43
vba copy paste previous line 3 6
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question