close

I am trying sort data by headers in a situation where I have a lot of
variables but some are missing. I have all my data like this:

City A Value for variable 1
City B Value for variable 1
City C Value for variable 1

City A Value for variable 2
City B Value for variable 2
City C Value for variable 2

My problem is, that sometimes I do not have the data for some variable for a
given city. For these cities, I do not have the city name either. To do
plots, I put the data into the same worksheet in adjacent columns.

What happens is this:
City A Value for variable 1 City A Value for variable 2
City B Value for variable 1 City C Value for variable 2
City C Value for variable 1 City D Value for variable 2
City D Value for variable 1 City E Value for variable 2

This is what I would need:
City A Value for variable 1 City A Value for variable 2
City B Value for variable 1
City C Value for variable 1 City C Value for variable 2
City D Value for variable 1 City D Value for variable 2

I would like to do this for all my variables for an end result like this:
City A Value for variable 1 Value for variable 2 Value for variable 3
City B Value for variable 1 N/A Value for
variable 3
City C Value for variable 1 Value for variable 2 N/A
City D Value for variable 1 Value for variable 2 Value for variable 3
Etc.

Any advice will be greatly appreciated.Hi MarkusO,

It looks like you may have solved the problem already. How feasible is it
to simply assign quot;N/Aquot; as the Text value for any variable that does not have
a value before sorting or before plotting?

If this is not feasible, let me know why, so that I have more info to work
with in helping you solve your data issue.

~Rob Waltonquot;MarkusOquot; gt; wrote in message
news
gt;I am trying sort data by headers in a situation where I have a lot of
gt; variables but some are missing. I have all my data like this:
gt;
gt; City A Value for variable 1
gt; City B Value for variable 1
gt; City C Value for variable 1
gt;
gt; City A Value for variable 2
gt; City B Value for variable 2
gt; City C Value for variable 2
gt;
gt; My problem is, that sometimes I do not have the data for some variable for
gt; a
gt; given city. For these cities, I do not have the city name either. To do
gt; plots, I put the data into the same worksheet in adjacent columns.
gt;
gt; What happens is this:
gt; City A Value for variable 1 City A Value for variable 2
gt; City B Value for variable 1 City C Value for variable 2
gt; City C Value for variable 1 City D Value for variable 2
gt; City D Value for variable 1 City E Value for variable 2
gt;
gt; This is what I would need:
gt; City A Value for variable 1 City A Value for variable 2
gt; City B Value for variable 1
gt; City C Value for variable 1 City C Value for variable 2
gt; City D Value for variable 1 City D Value for variable 2
gt;
gt; I would like to do this for all my variables for an end result like this:
gt; City A Value for variable 1 Value for variable 2 Value for variable 3
gt; City B Value for variable 1 N/A Value for
gt; variable 3
gt; City C Value for variable 1 Value for variable 2 N/A
gt; City D Value for variable 1 Value for variable 2 Value for variable 3
gt; Etc.
gt;
gt; Any advice will be greatly appreciated.
gt;Hi

The problem is that if I do not have the variable I do not have the city
name either. Putting N/A is not feasible as I have no way of adding the
missing cities into the lists.

I have a list of all cities like this (total 430 cities):
Alahärmä
Alajärvi
Alastaro
Alavieska
Alavus
Anjalankoski
Artjärvi
Asikkala
Askainen
Askola
Aura
Brändö
Dragsfjärd
Eckerö
Elimäki
Eno
Enonkoski
Enontekiö
Espoo
Eura
Eurajoki
Evijärvi
Finström
Forssa
Föglö
Geta

I have value lists like this:
Espoo1
Hamina1
Haukivuori1
Heinävesi1
Helsinki1
Hirvensalmi1
Houtskari1
Hyrynsalmi1
Isojoki1
Joroinen1
Jurva1
Juva1
Kangasniemi1
Karijoki1
Kauhajoki1
Kauniainen1
Kontiolahti1
Korppoo1
Korsnäs1
Kuhmo1
Kuivaniemi1
Kuopio1
Lohja1
Maalahti1
Mäntsälä1
Mäntyharju1
Nauvo1
Nurmes1
Pertunmaa1
Pieksämäki1
Pieksänmaa1
Pielavesi1
Porvoo1
Punkaharju1
Puolanka1
Puumala1
Rantasalmi1
Rautalampi1
Riihimäki1
Ristiina1
Savonranta1
Sotkamo1
Sulkava1
Tampere1
Teuva1
Turku1
Tuusula1
Vantaa1
Virolahti1
Ylikiiminki1

Not like this:
Alahärmä
Alajärvi
Alastaro
Alavieska
Alavus
Anjalankoski
Artjärvi
Asikkala
Askainen
Askola
Aura
Brändö
Dragsfjärd
Eckerö
Elimäki
Eno
Enonkoski
Enontekiö
Espoo 1
Eura
Eurajoki
Evijärvi
Finström
Forssa
Föglö
Geta

(The values are not always 1, here the data type just happens to be binary)

So, I would like to quot;alignquot; these too lists so that the values would pop
next to the right city in the city name list. I would like to repeat this for
many many variables for end result like this (with about 30 variables):
City Name Population PopDensity CompDummy1 CompDummy2 GDPperCapita
Alahärmä 32004 533,5 1 0 53435€
Alajärvi 435224 1560,1 0 1 43555€
etc.

My problem is that now I type all the missing cities to the second list by
hand, which becomes unfeasible. I have done this kind of straight typing now
for one week already with my data. Also, sometimes in my lists the city list
is old ie. there is no matching town that exists anymore.

I hope this helps in understanding the problem more.

BR
Markus

quot;Rob Waltonquot; wrote:

gt; Hi MarkusO,
gt;
gt; It looks like you may have solved the problem already. How feasible is it
gt; to simply assign quot;N/Aquot; as the Text value for any variable that does not have
gt; a value before sorting or before plotting?
gt;
gt; If this is not feasible, let me know why, so that I have more info to work
gt; with in helping you solve your data issue.
gt;
gt; ~Rob Walton
gt;
gt;
gt; quot;MarkusOquot; gt; wrote in message
gt; news
gt; gt;I am trying sort data by headers in a situation where I have a lot of
gt; gt; variables but some are missing. I have all my data like this:
gt; gt;
gt; gt; City A Value for variable 1
gt; gt; City B Value for variable 1
gt; gt; City C Value for variable 1
gt; gt;
gt; gt; City A Value for variable 2
gt; gt; City B Value for variable 2
gt; gt; City C Value for variable 2
gt; gt;
gt; gt; My problem is, that sometimes I do not have the data for some variable for
gt; gt; a
gt; gt; given city. For these cities, I do not have the city name either. To do
gt; gt; plots, I put the data into the same worksheet in adjacent columns.
gt; gt;
gt; gt; What happens is this:
gt; gt; City A Value for variable 1 City A Value for variable 2
gt; gt; City B Value for variable 1 City C Value for variable 2
gt; gt; City C Value for variable 1 City D Value for variable 2
gt; gt; City D Value for variable 1 City E Value for variable 2
gt; gt;
gt; gt; This is what I would need:
gt; gt; City A Value for variable 1 City A Value for variable 2
gt; gt; City B Value for variable 1
gt; gt; City C Value for variable 1 City C Value for variable 2
gt; gt; City D Value for variable 1 City D Value for variable 2
gt; gt;
gt; gt; I would like to do this for all my variables for an end result like this:
gt; gt; City A Value for variable 1 Value for variable 2 Value for variable 3
gt; gt; City B Value for variable 1 N/A Value for
gt; gt; variable 3
gt; gt; City C Value for variable 1 Value for variable 2 N/A
gt; gt; City D Value for variable 1 Value for variable 2 Value for variable 3
gt; gt; Etc.
gt; gt;
gt; gt; Any advice will be greatly appreciated.
gt; gt;
gt;
gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()