If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Find the lowest number and place the number and Column name into in Field

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-05, 10:51
cle5cap cle5cap is offline
Registered User
 
Join Date: Mar 2004
Posts: 29
Lightbulb Find the lowest number and place the number and Column name into in Field

I have in Excel the following columns nams and data.

DestZipCode,Origin44114,Origin90210,Origin44105,Op timalOrigin
00501,2,5,2
00544,3,5,1
01003,2,2,5


What I need to to is look into each row and find out the lowest number and place the column name into
another field. If the lowest number has 1 or 2 values then have both column names in the OptimalOrigin
field. I have 42,000 different zipcode.

Example
DestZipCode,Origin44114,Origin90210,Origin44105,Op timalOrigin
00501,2,5,2,Origin44114 Origin44105
00544,3,5,1,Origin44105

What would be the formula needed to get these resaults?

Any help would be great!
Thank You!
Reply With Quote
  #2 (permalink)  
Old 12-08-05, 14:44
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Howdy. Not sure if I fully understand, but here is a possible solution.

If the following are accurate, assuming only Columns B, C, and D have conditions to test, with these titles in Row 1:

column A: DestZipCode
Column B: Origin44114
Column C: Origin90210
Column D: Origin44105

Then put this into cell E2

=IF($B2=MIN($B2:$D2),B$1,IF($C2=MIN($B2:$D2),C$1,D $1))

and this into cell F2

=IF(AND($B2=MIN($B2:$D2),$C2=MIN($B2:$D2)),C$1,IF( AND($B2=MIN($B2:$D2),$D2=MIN($B2:$D2)),D$1,""))

and this into cell G2

=IF(AND($B2=$C2,$B2=$D2),D$1,"")
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 12-08-05, 15:03
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
don't do this, it's going to shoot you in the foot for the reasons I mentioned in your post in the access forum. This is for import into a RELATIONAL database, there's a reason they call it a relational database and not "group of spreadsheets" database.

Seriously, the extra work will save you acute brain trauma in the near future.
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #4 (permalink)  
Old 12-08-05, 15:51
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Guess I missed out on what this was for. hmmmm it helps to get the full story.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #5 (permalink)  
Old 12-09-05, 08:01
cle5cap cle5cap is offline
Registered User
 
Join Date: Mar 2004
Posts: 29
Thank you very much Shades this works perfect I think you should be called the MONKEY not the other guy (That thinks he is the Access Monkey) its people like him that "THINKs" he know everything I am just a newbie with these kind of formulas and was in need of help not just attitude. I hope in the future I will get help from people like you!

AGAIN I CAN NOT THANK YOU ENOUGH YOU SAVE ME A TON OF TIME!!
Reply With Quote
  #6 (permalink)  
Old 12-09-05, 09:04
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Great. Glad to help, and thanks for coming back to report on whether the offered solution was appropriate. It helps you, me, and others who read.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #7 (permalink)  
Old 12-09-05, 10:15
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Quote:
Originally Posted by cle5cap
Thank you very much Shades this works perfect I think you should be called the MONKEY not the other guy (That thinks he is the Access Monkey) its people like him that "THINKs" he know everything I am just a newbie with these kind of formulas and was in need of help not just attitude. I hope in the future I will get help from people like you!

AGAIN I CAN NOT THANK YOU ENOUGH YOU SAVE ME A TON OF TIME!!
lol!

I'm trying to rip on you for being new, I'm trying to help you not make severe mistakes that will require you to build work around after work around instead of simple solutions.

Take it as you will...
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***
Reply With Quote
  #8 (permalink)  
Old 12-09-05, 17:15
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Reminds of a discussion from 2 years ago: Excel vs Access?
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #9 (permalink)  
Old 12-12-05, 15:45
Teddy Teddy is offline
Purveyor of Discontent
 
Join Date: Mar 2003
Location: The Bottom of The Barrel
Posts: 6,075
Quote:
Originally Posted by shades
Reminds of a discussion from 2 years ago: Excel vs Access?
Slightly different. Had he not posted in the Access forum thereby indicating he's trying to use a relational platform, I would say excel works just fine. I prefer it for anything that doesn't involve relationships between multiple entities, from what I understand, this is not one of those situations.

edit: Ho ho, what have we here? It would appear to be a textbook example of why I was pushing for a normalized solution...
__________________
oh yeah... documentation... I have heard of that.

*** What Do You Want In The MS Access Forum? ***

Last edited by Teddy; 12-15-05 at 11:29.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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