Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default auto populate a field based on other fields


I have an excel sheet where I want to auto populate a field (that has
specific values listed in a drop down menu) based on two other fields (both
are dropdown menus with specific values)

For Eg.:
there are 3 fields A, B, C and all these three fields have specific values
which we can select through a drop down menu. Now, Lets say values in the
fields are as follows:

A: 1, 2, 3, 4, 5
B: 1, 2, 3, 4, 5
C: a, b, c

So now, If I select '1' for A and '1' for B then I DONT want any thing to
populate in C and leave it blank.
If I select '1' for A and '2' for B then I want 'a' to be populated in C
If I select '2' for A and '1' for B then I want 'b' to be populated in C
If I select '1' for A and '1' for B then I want 'c' to be populated in C

Basically,
If the value in field A is smaller then field B then I want 'a' to be
populated in C.
If the value in field B is smaller then field A then I want 'b' to be
populated in C.
If the value in field A and B are equal then I want 'c' to be populated in C.

Hope I made it clear enough.

Thanks in Advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default auto populate a field based on other fields


The below formula will do

In C1
=IF(A1<B1,"a",IF(A1=B1,"c","b"))

Further to handle blank entries
=IF(COUNT(A1:B1),IF(A1<B1,"a",IF(A1=B1,"c","b"))," ")

If this post helps click Yes
---------------
Jacob Skaria


"sam" wrote:

I have an excel sheet where I want to auto populate a field (that has
specific values listed in a drop down menu) based on two other fields (both
are dropdown menus with specific values)

For Eg.:
there are 3 fields A, B, C and all these three fields have specific values
which we can select through a drop down menu. Now, Lets say values in the
fields are as follows:

A: 1, 2, 3, 4, 5
B: 1, 2, 3, 4, 5
C: a, b, c

So now, If I select '1' for A and '1' for B then I DONT want any thing to
populate in C and leave it blank.
If I select '1' for A and '2' for B then I want 'a' to be populated in C
If I select '2' for A and '1' for B then I want 'b' to be populated in C
If I select '1' for A and '1' for B then I want 'c' to be populated in C

Basically,
If the value in field A is smaller then field B then I want 'a' to be
populated in C.
If the value in field B is smaller then field A then I want 'b' to be
populated in C.
If the value in field A and B are equal then I want 'c' to be populated in C.

Hope I made it clear enough.

Thanks in Advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 699
Default auto populate a field based on other fields


Hi Jacob,

Thanks for the reply.

the values I gave in were just an example. There are no numeric values in
any fields.

The concept that i explained is true, but the values are somewhat similar to
displayed as below:

A: Hello, What, Going, There
B: Did, Jolly, Cool, Tomorrow
C: Just, Did

so lets say for eg, If Hello and Did are selected, C will remain blanck
If Hello, Jolly are selected, C will populate to Jusst
If What and Did are selected, C will populate to Did

And so on.. I hope it is clearer now?

Thanks in Advance

"Jacob Skaria" wrote:

The below formula will do

In C1
=IF(A1<B1,"a",IF(A1=B1,"c","b"))

Further to handle blank entries
=IF(COUNT(A1:B1),IF(A1<B1,"a",IF(A1=B1,"c","b"))," ")

If this post helps click Yes
---------------
Jacob Skaria


"sam" wrote:

I have an excel sheet where I want to auto populate a field (that has
specific values listed in a drop down menu) based on two other fields (both
are dropdown menus with specific values)

For Eg.:
there are 3 fields A, B, C and all these three fields have specific values
which we can select through a drop down menu. Now, Lets say values in the
fields are as follows:

A: 1, 2, 3, 4, 5
B: 1, 2, 3, 4, 5
C: a, b, c

So now, If I select '1' for A and '1' for B then I DONT want any thing to
populate in C and leave it blank.
If I select '1' for A and '2' for B then I want 'a' to be populated in C
If I select '2' for A and '1' for B then I want 'b' to be populated in C
If I select '1' for A and '1' for B then I want 'c' to be populated in C

Basically,
If the value in field A is smaller then field B then I want 'a' to be
populated in C.
If the value in field B is smaller then field A then I want 'b' to be
populated in C.
If the value in field A and B are equal then I want 'c' to be populated in C.

Hope I made it clear enough.

Thanks in Advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default auto populate a field based on other fields


Suppose in Sheet2 Col A Col B ColC you have the below data starting from Row1.
ColA ColB ColC
Hello Did Just
What Jolly Did
Going Cool
There Tomorrow

In Sheet1 C1 enter the below formula.. Try changing the entries in A1 and B1

=IF(MATCH(A1,Sheet2!$A$1:$A$10,0)=MATCH(B1,Sheet2! $B$1:$B$10,0),"",IF(MATCH(A1,Sheet2!$A$1:$A$10,0)< MATCH(B1,Sheet2!$B$1:$B$10,0),Sheet2!C1,Sheet2!C2) )

If this post helps click Yes
---------------
Jacob Skaria


"sam" wrote:

Hi Jacob,

Thanks for the reply.

the values I gave in were just an example. There are no numeric values in
any fields.

The concept that i explained is true, but the values are somewhat similar to
displayed as below:

A: Hello, What, Going, There
B: Did, Jolly, Cool, Tomorrow
C: Just, Did

so lets say for eg, If Hello and Did are selected, C will remain blanck
If Hello, Jolly are selected, C will populate to Jusst
If What and Did are selected, C will populate to Did

And so on.. I hope it is clearer now?

Thanks in Advance

"Jacob Skaria" wrote:

The below formula will do

In C1
=IF(A1<B1,"a",IF(A1=B1,"c","b"))

Further to handle blank entries
=IF(COUNT(A1:B1),IF(A1<B1,"a",IF(A1=B1,"c","b"))," ")

If this post helps click Yes
---------------
Jacob Skaria


"sam" wrote:

I have an excel sheet where I want to auto populate a field (that has
specific values listed in a drop down menu) based on two other fields (both
are dropdown menus with specific values)

For Eg.:
there are 3 fields A, B, C and all these three fields have specific values
which we can select through a drop down menu. Now, Lets say values in the
fields are as follows:

A: 1, 2, 3, 4, 5
B: 1, 2, 3, 4, 5
C: a, b, c

So now, If I select '1' for A and '1' for B then I DONT want any thing to
populate in C and leave it blank.
If I select '1' for A and '2' for B then I want 'a' to be populated in C
If I select '2' for A and '1' for B then I want 'b' to be populated in C
If I select '1' for A and '1' for B then I want 'c' to be populated in C

Basically,
If the value in field A is smaller then field B then I want 'a' to be
populated in C.
If the value in field B is smaller then field A then I want 'b' to be
populated in C.
If the value in field A and B are equal then I want 'c' to be populated in C.

Hope I made it clear enough.

Thanks in Advance.

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
Auto Populate fields based upon dropdown selection Del Excel Discussion (Misc queries) 4 September 14th 09 09:43 PM
Auto populate fields Dianne Excel Discussion (Misc queries) 1 September 4th 08 01:36 PM
Auto populate other fields? sedonovan Excel Discussion (Misc queries) 3 June 21st 06 05:34 PM
Auto Populate fields Mark Excel Programming 1 September 15th 05 10:23 PM
Auto populate fields Mark Excel Discussion (Misc queries) 1 September 15th 05 08:45 PM


All times are GMT +1. The time now is 11:42 PM.

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"