Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Question about comparing 2 cell values

I have a sheet that has to columns of numbers. I would like to have a
formula that looks at the numbers in both columns (1 row at a time)
and gives me a result in column 3 based on that comparison.

Column A will be one of the following values= 0,1,2,3,4,8
Column B will be one of the following values=2,3,8

Here is my criteria for comparing the two (assuming I am comparing A1
and A2 first, with the result being in A3):

If A1=0 or 1 then A3=1 (no comparison needed on the first 3)
If A1=2 then A3=3
If A1=8 then A3=5
If A1=3 or 4 and A2=2 then A3=4
If A1=3 or 4 and A2=3 then A3=5

I can write out the specifics of what I need to compare.. I just have
no solid idea of how to put that into an Excel formula.

Any help at all is greatly appreciated.

Matt

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Question about comparing 2 cell values

Maybe one way:

=IF(OR(A1=0,A1=1),1,IF(A1=2,3,IF(A1=8,5,IF(AND(OR( A1=3,A1=4),A2=2),4,IF(AND(OR(A1=3,A1=4),A2=3),5,"N o
Match")))))

Regards,
Paul

"mCassidy" wrote in message
oups.com...
I have a sheet that has to columns of numbers. I would like to have a
formula that looks at the numbers in both columns (1 row at a time)
and gives me a result in column 3 based on that comparison.

Column A will be one of the following values= 0,1,2,3,4,8
Column B will be one of the following values=2,3,8

Here is my criteria for comparing the two (assuming I am comparing A1
and A2 first, with the result being in A3):

If A1=0 or 1 then A3=1 (no comparison needed on the first 3)
If A1=2 then A3=3
If A1=8 then A3=5
If A1=3 or 4 and A2=2 then A3=4
If A1=3 or 4 and A2=3 then A3=5

I can write out the specifics of what I need to compare.. I just have
no solid idea of how to put that into an Excel formula.

Any help at all is greatly appreciated.

Matt



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 173
Default Question about comparing 2 cell values

You can us nested IF statements ("=if(expression,result if true, result if
false)"). I'm a bit confused by the criteria because it looks like the data
is in rows rather than columns (you check A1 and A2 to determine the value of
A3 rather than checking A1 and B1 To get the value of C1). if your values
are truly in columns, the expression should look something like this:

=IF(OR(A1=0,A1=1),1,IF(A1=2,3,IF(A1=8,5,IF(AND(OR( A1=3,A1=4),B1=2),4,IF(AND(OR(A1=3,A1=4),B1=3),5,"e rror")))))

I stuck in the word "error" for any cases that pop up where your criteria
don't cover everything. NOTE that IF statements can only be nested 7 deep.

Will

"mCassidy" wrote:

I have a sheet that has to columns of numbers. I would like to have a
formula that looks at the numbers in both columns (1 row at a time)
and gives me a result in column 3 based on that comparison.

Column A will be one of the following values= 0,1,2,3,4,8
Column B will be one of the following values=2,3,8

Here is my criteria for comparing the two (assuming I am comparing A1
and A2 first, with the result being in A3):

If A1=0 or 1 then A3=1 (no comparison needed on the first 3)
If A1=2 then A3=3
If A1=8 then A3=5
If A1=3 or 4 and A2=2 then A3=4
If A1=3 or 4 and A2=3 then A3=5

I can write out the specifics of what I need to compare.. I just have
no solid idea of how to put that into an Excel formula.

Any help at all is greatly appreciated.

Matt


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Question about comparing 2 cell values

Thanks a ton! These posts really helped out.
....and yes.. I mis-stated how my data was arranged.. each instance
is in a row. i was thinking about it as two columns of data
though... my bad.

Thanks again :)

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
Help with Comparing values and retrieving values in Excel!!!!!! [email protected] Excel Worksheet Functions 1 November 17th 06 12:21 AM
Macro Help Needed: Comparing cell values and deleting rows [email protected] Excel Discussion (Misc queries) 1 September 19th 06 02:39 AM
Comparing multiple cell values scoobydoo2006 Excel Discussion (Misc queries) 0 June 13th 06 04:58 PM
Comparing cell values then labeling them based on comparision Andrew Excel Discussion (Misc queries) 1 September 13th 05 11:11 PM
Counting values and comparing them to a single cell Tbentsen Excel Discussion (Misc queries) 3 August 4th 05 10:47 PM


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