Relationship between tables doesn't seem to work for some values

Waimea

Active Member
Joined
Jun 30, 2018
Messages
465
Office Version
  1. 365
Platform
  1. Windows
Hi, I have two tables, one data table and one lookup table.

However, the lookup table doesn't seem to work for all values of the lookup table below:

Code:
[TABLE]
<tbody>[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD][B]1-5[/B][/TD]
[/TR]
[TR]
[TD][B]6-15[/B][/TD]
[/TR]
[TR]
[TD]16-19[/TD]
[/TR]
[TR]
[TD]20-29[/TD]
[/TR]
[TR]
[TD]30-39[/TD]
[/TR]
[TR]
[TD]40-49[/TD]
[/TR]
[TR]
[TD]50-64[/TD]
[/TR]
[TR]
[TD]65-74[/TD]
[/TR]
[TR]
[TD]75-79[/TD]
[/TR]
[TR]
[TD]80-89[/TD]
[/TR]
[TR]
[TD]90-w[/TD]
[/TR]
</tbody>[/TABLE]

For lookup table value of 1-5 and 6-15 the relationship doesn't seem to work and the values gives me a total instead of a part of a sum. I am thinking that this could be because of sorting or something similar to that.

Is there any workaround for this?
r6QQG1y
In the image below, the 6-15 should give me 5235 and it gives me 44955 and I don't know why??
r6QQG1y


https://ibb.co/r6QQG1y

r6QQG1y
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Any suggestions on how to fix this problem? It really bothers me that I can't figure out why the lookup doesn't work!
 
Upvote 0
ABC
1CityAge2017
14City (Suburb 1)01135
15City (Suburb 1)1-54395
16City (Suburb 1)6-155455
17City (Suburb 1)16-191835
18City (Suburb 1)20-2914265
19City (Suburb 1)30-3915155
20City (Suburb 1)40-498720
21City (Suburb 1)50-6410515
22City (Suburb 1)65-745105
23City (Suburb 1)75-791475
24City (Suburb 1)80-891645
25City (Suburb 1)90-w410

<tbody>
</tbody>

Column A is city name, column B is the same as my lookup table, column C is the population in that age group.

The lookup table works for age 0, 16-19, 20-29, 30-39, 40-49, 50-64, 65-74, 75-79, 80-80 and 90-w.

It doesn't work for age 1-5 and 6-15.
 
Last edited:
Upvote 0
Could age 1-5 and 6-15 be interpreted as dates?
 
Upvote 0
Could age 1-5 and 6-15 be interpreted as dates?

Change the set up like below:



Book1
ABCD
1CityAge2017
14City (Suburb 1)01135
15City (Suburb 1)154395
16City (Suburb 1)6155455
17City (Suburb 1)16191835
18City (Suburb 1)202914265
19City (Suburb 1)303915155
20City (Suburb 1)40498720
21City (Suburb 1)506410515
22City (Suburb 1)65745105
23City (Suburb 1)75791475
24City (Suburb 1)80891645
25City (Suburb 1)90w410
Sheet1
 
Last edited:
Upvote 0
Hi Aladin,

I have changed my setup as per your very clever suggestion!

I am using PowerPivot but I am unsure how to set up my lookup table?

Code:
2017 1-5:=CALCULATE([Population 2017] ;'Age'[Age] >="1" && 'Age'[Age] <="5")
 
Upvote 0
I got it to work. Thank you very much Aladin!

Your suggestion is really good and clever!
 
Upvote 0
If someone has the time, please show me how to set up my lookup tablesfor this set up??
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,170
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top