Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with Comparing values and retrieving values in Excel!!!!!! | Excel Worksheet Functions | |||
Macro Help Needed: Comparing cell values and deleting rows | Excel Discussion (Misc queries) | |||
Comparing multiple cell values | Excel Discussion (Misc queries) | |||
Comparing cell values then labeling them based on comparision | Excel Discussion (Misc queries) | |||
Counting values and comparing them to a single cell | Excel Discussion (Misc queries) |