Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default comparing 2 columns info to fill 3rd column

I have 2 columns (i.e. origin & destination) & I want it to compare to data
in other part of spreadsheet to fill in miles between origin & destination.

For example: Chicago to Des Moines. I have Chicago in the origin column
and Des Moines in the destination column. I have the miles already
calculated for that run in another part of the spreadsheet, so every time I
fill in the orgin as Chicago & Destination as Des Moines, I want the correct
miles to fill in the mileage column.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JNW JNW is offline
external usenet poster
 
Posts: 480
Default comparing 2 columns info to fill 3rd column

how is your mileage calculation sheet set up?
--
JNW


"quinn111" wrote:

I have 2 columns (i.e. origin & destination) & I want it to compare to data
in other part of spreadsheet to fill in miles between origin & destination.

For example: Chicago to Des Moines. I have Chicago in the origin column
and Des Moines in the destination column. I have the miles already
calculated for that run in another part of the spreadsheet, so every time I
fill in the orgin as Chicago & Destination as Des Moines, I want the correct
miles to fill in the mileage column.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default comparing 2 columns info to fill 3rd column

The mileage is just entered into cells, no calculation.
In this example: I have orgin, destination & mileage columns in the same
spreadsheet as the main, just off to the right.

"JNW" wrote:

how is your mileage calculation sheet set up?
--
JNW


"quinn111" wrote:

I have 2 columns (i.e. origin & destination) & I want it to compare to data
in other part of spreadsheet to fill in miles between origin & destination.

For example: Chicago to Des Moines. I have Chicago in the origin column
and Des Moines in the destination column. I have the miles already
calculated for that run in another part of the spreadsheet, so every time I
fill in the orgin as Chicago & Destination as Des Moines, I want the correct
miles to fill in the mileage column.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default comparing 2 columns info to fill 3rd column

Try this,
copy this matrix starting in cell c34.

1 2 3 4 5
a 5 6 11 16 21
b 6 7 12 17 22
c 7 8 13 18 23
d 8 9 14 19 24
e 9 10 15 20 25


c 4

18
=OFFSET(C34,MATCH(C42,C35:C39,0),MATCH(D42,D34:H34 ,0))

peter


"quinn111" wrote:

I have 2 columns (i.e. origin & destination) & I want it to compare to data
in other part of spreadsheet to fill in miles between origin & destination.

For example: Chicago to Des Moines. I have Chicago in the origin column
and Des Moines in the destination column. I have the miles already
calculated for that run in another part of the spreadsheet, so every time I
fill in the orgin as Chicago & Destination as Des Moines, I want the correct
miles to fill in the mileage column.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JNW JNW is offline
external usenet poster
 
Posts: 480
Default comparing 2 columns info to fill 3rd column

Try
=sumproduct(--(sheet2!A1:A50=A1),--(sheet2!B1:B50=B1),--(sheet2!C1:C50))

Sheet2 is where the stored distances are.
--
JNW


"quinn111" wrote:

The mileage is just entered into cells, no calculation.
In this example: I have orgin, destination & mileage columns in the same
spreadsheet as the main, just off to the right.

"JNW" wrote:

how is your mileage calculation sheet set up?
--
JNW


"quinn111" wrote:

I have 2 columns (i.e. origin & destination) & I want it to compare to data
in other part of spreadsheet to fill in miles between origin & destination.

For example: Chicago to Des Moines. I have Chicago in the origin column
and Des Moines in the destination column. I have the miles already
calculated for that run in another part of the spreadsheet, so every time I
fill in the orgin as Chicago & Destination as Des Moines, I want the correct
miles to fill in the mileage column.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default comparing 2 columns info to fill 3rd column

You can shorten that to

=SUMPRODUCT(--(Sheet2!A1:A50=A1),--(Sheet2!B1:B50=B1),Sheet2!C1:C50)


--


Regards,


Peo Sjoblom


"JNW" wrote in message
...
Try
=sumproduct(--(sheet2!A1:A50=A1),--(sheet2!B1:B50=B1),--(sheet2!C1:C50))

Sheet2 is where the stored distances are.
--
JNW


"quinn111" wrote:

The mileage is just entered into cells, no calculation.
In this example: I have orgin, destination & mileage columns in the same
spreadsheet as the main, just off to the right.

"JNW" wrote:

how is your mileage calculation sheet set up?
--
JNW


"quinn111" wrote:

I have 2 columns (i.e. origin & destination) & I want it to compare
to data
in other part of spreadsheet to fill in miles between origin &
destination.

For example: Chicago to Des Moines. I have Chicago in the origin
column
and Des Moines in the destination column. I have the miles already
calculated for that run in another part of the spreadsheet, so every
time I
fill in the orgin as Chicago & Destination as Des Moines, I want the
correct
miles to fill in the mileage column.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default comparing 2 columns info to fill 3rd column

Thanks Peter.
That works, except I changed the values on the formula to absolutes ($) (see
below), but when I copy it, it doesn't work.
Please help.

"peter" wrote:

Try this,
copy this matrix starting in cell c34.

1 2 3 4 5
a 5 6 11 16 21
b 6 7 12 17 22
c 7 8 13 18 23
d 8 9 14 19 24
e 9 10 15 20 25


c 4

18
=OFFSET($C$34,MATCH(C42,$C$35:$C$39,0),MATCH(D42,$ D$34:$H$34,0))

peter


"quinn111" wrote:

I have 2 columns (i.e. origin & destination) & I want it to compare to data
in other part of spreadsheet to fill in miles between origin & destination.

For example: Chicago to Des Moines. I have Chicago in the origin column
and Des Moines in the destination column. I have the miles already
calculated for that run in another part of the spreadsheet, so every time I
fill in the orgin as Chicago & Destination as Des Moines, I want the correct
miles to fill in the mileage column.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two columns containing Date info Colin Hayes Excel Worksheet Functions 10 May 13th 07 01:28 AM
swapping column info between 2 columns rosy Excel Worksheet Functions 1 September 22nd 06 06:49 AM
How do I create two columns from one column (space separated info vikki_socal Excel Worksheet Functions 2 May 25th 06 04:14 PM
Same info from one column to different columns in multiple worksheets B_K Excel Discussion (Misc queries) 5 April 27th 06 12:31 AM
comparing a column of cell and then copy info to other cells Kelly******** Excel Discussion (Misc queries) 0 March 21st 06 09:51 AM


All times are GMT +1. The time now is 06:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"