Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default Formula help, please.

I have a table in which the entries in column A can be A, B or C and the entries in column B can be D, E or F (A through F are text entries, not numbers). I want column C to return numbers representing the combination of the text entries in columns A and B. For example, if cell A1 is A and cell B1 is D, I want cell C1 to return the number 10. Similarly, if cell A2 is B and cell B2 is E, I want cell C2 to return the number 4.

These are the possible combinations:
Column A/Column B/Column C
A/D/10
A/E/6
A/F/4
B/D/6
B/E/4
B/F/2
C/D/4
C/E/2
C/F/1

How do I do this? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Formula help, please.

saroman wrote:

I have a table in which the entries in column A can be A, B or C and the
entries in column B can be D, E or F (A through F are text entries, not
numbers). I want column C to return numbers representing the
combination of the text entries in columns A and B. For example, if
cell A1 is A and cell B1 is D, I want cell C1 to return the number 10.
Similarly, if cell A2 is B and cell B2 is E, I want cell C2 to return
the number 4.

These are the possible combinations:
Column A/Column B/Column C
A/D/10
A/E/6
A/F/4
B/D/6
B/E/4
B/F/2
C/D/4
C/E/2
C/F/1

How do I do this? Thanks.


Paste this into C1 and then copy down (watch the wordwrap; this is all one
line):

=IF(A1="A",IF(B1="D",10,IF(B1="E",6,IF(B1="F",4,"" ))),IF(A1="B",IF(B1
="D",6,IF(B1="E",4,IF(B1="F",2,""))),IF(A1="C",IF( B1="D",4,IF(B1="E",2,IF(B1
="F",1,""))),"")))

There's probably a better way to do it, but this works.

--
He carried himself like an angry ox.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Formula help, please.

On Fri, 29 Jun 2012 00:52:10 +0000, saroman wrote:


I have a table in which the entries in column A can be A, B or C and the
entries in column B can be D, E or F (A through F are text entries, not
numbers). I want column C to return numbers representing the
combination of the text entries in columns A and B. For example, if
cell A1 is A and cell B1 is D, I want cell C1 to return the number 10.
Similarly, if cell A2 is B and cell B2 is E, I want cell C2 to return
the number 4.

These are the possible combinations:
Column A/Column B/Column C
A/D/10
A/E/6
A/F/4
B/D/6
B/E/4
B/F/2
C/D/4
C/E/2
C/F/1

How do I do this? Thanks.


Since you indicate the range of possible combinations, then you can try:

=INDEX({10,6,4,2,1},MATCH(A1,{"A","B","C"},0)+MATC H(B1,{"D","E","F"},0)-1)

Any other combination will result in an error message.
The match is case INsensitive. If you need a case SENSITIVE match, post back.
  #4   Report Post  
Junior Member
 
Posts: 3
Default

Thanks so much. Your solution worked. The only difference between your solution and the first one suggested is that, as you indicated, the other combinations returned "#N/A" to the cells in column C whereas the first solution left those cells blank.

Quote:
Originally Posted by Ron Rosenfeld[_2_] View Post
On Fri, 29 Jun 2012 00:52:10 +0000, saroman wrote:


I have a table in which the entries in column A can be A, B or C and the
entries in column B can be D, E or F (A through F are text entries, not
numbers). I want column C to return numbers representing the
combination of the text entries in columns A and B. For example, if
cell A1 is A and cell B1 is D, I want cell C1 to return the number 10.
Similarly, if cell A2 is B and cell B2 is E, I want cell C2 to return
the number 4.

These are the possible combinations:
Column A/Column B/Column C
A/D/10
A/E/6
A/F/4
B/D/6
B/E/4
B/F/2
C/D/4
C/E/2
C/F/1

How do I do this? Thanks.


Since you indicate the range of possible combinations, then you can try:

=INDEX({10,6,4,2,1},MATCH(A1,{"A","B","C"},0)+MATC H(B1,{"D","E","F"},0)-1)

Any other combination will result in an error message.
The match is case INsensitive. If you need a case SENSITIVE match, post back.
  #5   Report Post  
Junior Member
 
Posts: 3
Default

Perfect! Thanks very much. I really appreciate it.

Quote:
Originally Posted by Auric__ View Post
saroman wrote:

I have a table in which the entries in column A can be A, B or C and the
entries in column B can be D, E or F (A through F are text entries, not
numbers). I want column C to return numbers representing the
combination of the text entries in columns A and B. For example, if
cell A1 is A and cell B1 is D, I want cell C1 to return the number 10.
Similarly, if cell A2 is B and cell B2 is E, I want cell C2 to return
the number 4.

These are the possible combinations:
Column A/Column B/Column C
A/D/10
A/E/6
A/F/4
B/D/6
B/E/4
B/F/2
C/D/4
C/E/2
C/F/1

How do I do this? Thanks.


Paste this into C1 and then copy down (watch the wordwrap; this is all one
line):

=IF(A1="A",IF(B1="D",10,IF(B1="E",6,IF(B1="F",4,"" ))),IF(A1="B",IF(B1
="D",6,IF(B1="E",4,IF(B1="F",2,""))),IF(A1="C",IF( B1="D",4,IF(B1="E",2,IF(B1
="F",1,""))),"")))

There's probably a better way to do it, but this works.

--
He carried himself like an angry ox.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Formula help, please.

On Fri, 29 Jun 2012 16:07:29 +0000, saroman wrote:

Thanks so much. Your solution worked. The only difference between your
solution and the first one suggested is that, as you indicated, the
other combinations returned "#N/A" to the cells in column C whereas the
first solution left those cells blank.


Glad to help. Thanks for the feedback.
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
Build formula using field values as text in the formula referencing another workbook solardirect Links and Linking in Excel 6 June 4th 12 10:47 PM
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ[_3_] Excel Worksheet Functions 2 June 2nd 10 03:45 PM
extract formula result form cell without running formula again jason Excel Programming 4 August 14th 09 02:01 AM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 04:46 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"