Formula with multiple conditions

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello guys,
I am trying to enter an if formula to get the result. But as there are multiple conditions I am not able to write the formula. I require your expertise to get the correct formula. The expected result is manually entered in column E. The 3 conditions to be included in the formula as shown in the image.
Query to match Portal+Tally.xlsx
ABCDEFGHI
1abcdefgh
21445PORTAL03AAFCC9473R1ZZMatched1924.36=IF(B2<>B3,C2=C3,H2=H3,"Matched","")
31877TALLY03AAFCC9473R1ZZMatched1924.36
4571PORTAL03AAFCC9473R1ZZMatched8555.43
51860TALLY03AAFCC9473R1ZZMatched8555.43
61446PORTAL03AAFCC9473R1ZZ9313.92
72118TALLY06AAACL2096A1ZZ4602.00
8397PORTAL06AAACL2096A1ZZ4602.00
9272PORTAL06AACCE2411Q1ZO246400.00
101604PORTAL06AAFCC9473R1ZT6879.82
111605PORTAL06AAFCC9473R1ZT10200.96
12379PORTAL06AAFCC9473R1ZT11011.10
13771PORTAL06AALFP8162H1ZXMatched4720.00
142496TALLY06AALFP8162H1ZXMatched4720.00
15769PORTAL06AALFP8162H1ZXMatched18762.00
162495TALLY06AALFP8162H1ZXMatched18762.00
171557PORTAL06AALFP8162H1ZXMatched19706.00
182498TALLY06AALFP8162H1ZXMatched19706.00
191558PORTAL06AALFP8162H1ZX23600.00
201559PORTAL06AALFP8162H1ZX38940.00
21770PORTAL06AALFP8162H1ZXMatched39613.00
222497TALLY06AALFP8162H1ZXMatched39613.00
23636PORTAL27AACFE3300R1ZEMatched46800.00
24638PORTAL27AACFE3300R1ZEMatched46800.00
251934TALLY27AACFE3300R1ZEMatched46800.00
261936TALLY27AACFE3300R1ZEMatched46800.00
271159PORTAL27AACFE3300R1ZE53200.00
281551PORTAL29AAACB9461B1ZS138516.00
29222PORTAL29AAACB9461B1ZSMatched142800.00
301761TALLY29AAACB9461B1ZSMatched142800.00
312063TALLY29AAACI5569D1ZGMatched7943.76
321236PORTAL29AAACI5569D1ZGMatched7943.76
Match Portal & Tally
 
I understand an Index function in the formula will help, but I am not so good at it.
 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I understand an Index function in the formula will help, but I am not so good at it.
can you explain why rows 7 & 8 do not count as a match in your expected matches example as they appear to fit the three criteria you stipulated
 
Upvote 0
Row 8, the amount column, counts. Row 7 is blank.
 
Upvote 0
Row 8, the amount column, counts. Row 7 is blank.
Sorry do not understand your reply.
Your initial criteria were B7<> B8 so criteria met, C7=C8, criteria met, H7=H8, criteria met so by your inital request this should = matched
 
Upvote 0
No problem. I was waiting for the solution. Time to hit the sack. Thanks for your time gordsky. Will try again tomorrow.
 
Upvote 0
Where do I start?

Row 8, the amount column, counts. Row 7 is blank.

You are confusing the terminology. Rows go across the page, Columns are vertical (Up/Down the page). So when you say Row 7 is blank, you should have said Column 7 is blank. Think of it like a column that holds up the floor of a building, they are vertical. ;)

No problem. I was waiting for the solution. Time to hit the sack. Thanks for your time gordsky. Will try again tomorrow.

The formula @gordsky posted in post #4 meets the criteria that you mentioned the formula should do.

I think I can see what you are trying to do, but just when I thought that, your expected results don't meet what I think you are trying to do.

Let me explain what I thought you were trying to do based on your 'expected results'. It appears that you are trying to 'pair' up matches that meet your criteria and when the 'match' to your criteria is met, you want both of the 'matches' marked as a 'matched' and then move on to the next row and look for another 2 consecutive 'matches' to your criteria. The problem I ran into with that thinking is that some of the results you marked as 'matched' in your 'expected results' do not meet the first criteria for the B column.

Perhaps rethink what you are actually wanting to do and make another post here with any clarifications that you think should be made.
 
Upvote 0
you are trying to 'pair' up matches that meet your criteria and when the 'match' to your criteria is met, you want both of the 'matches' marked as a 'matched' and then move on to the next row and look for another 2 consecutive 'matches' to your criteria
Exactly. I just finished matching 20,000 rows yesterday. It took me 4 hours to match manually. I thought a formula will make it in seconds. I will try to explain again. The original data looks like in the below image. I sorted the data by column B as that is the only common factor between PORTAL and TALLY. Then I filter the headings and deleselect all and check each ID No. at a time and check the amounts. If the amounts are the same and ID No. is same, it is a match. I manuallly enter Matched in each of the rows.
If I apply a formula in column E, I don't have to sort nor filter. The formula will take the ID No. & the amount in Portal and search for the same in TALLY rows and display matched in both the rows.
Query to match Portal+Tally.xlsx
ABCDEFGH
1abcdGordsky's formulafgh
2222PORTAL29AAACB9461B1ZS 142800.00
3272PORTAL06AACCE2411Q1ZO 246400.00
4379PORTAL06AAFCC9473R1ZT 11011.10
5397PORTAL06AAACL2096A1ZZ 4602.00
6571PORTAL03AAFCC9473R1ZZ 8555.43
7636PORTAL27AACFE3300R1ZE 46800.00
8638PORTAL27AACFE3300R1ZE 46800.00
9769PORTAL06AALFP8162H1ZX 18762.00
10770PORTAL06AALFP8162H1ZX 39613.00
11771PORTAL06AALFP8162H1ZX 4720.00
121159PORTAL27AACFE3300R1ZE 53200.00
131236PORTAL29AAACI5569D1ZG 7943.76
141445PORTAL03AAFCC9473R1ZZ 1924.36
151446PORTAL03AAFCC9473R1ZZ 9313.92
161551PORTAL29AAACB9461B1ZS 138516.00
171557PORTAL06AALFP8162H1ZX 19706.00
181558PORTAL06AALFP8162H1ZX 23600.00
191559PORTAL06AALFP8162H1ZX 38940.00
201604PORTAL06AAFCC9473R1ZT 6879.82
211605PORTAL06AAFCC9473R1ZT 10200.96
221761TALLY29AAACB9461B1ZS 142800.00
231860TALLY03AAFCC9473R1ZZ 8555.43
241877TALLY03AAFCC9473R1ZZ 1924.36
251934TALLY27AACFE3300R1ZE 46800.00
261936TALLY27AACFE3300R1ZE 46800.00
272063TALLY29AAACI5569D1ZG 7943.76
282118TALLY06AAACL2096A1ZZ 4602.00
292495TALLY06AALFP8162H1ZX 18762.00
302496TALLY06AALFP8162H1ZX 4720.00
312497TALLY06AALFP8162H1ZX 39613.00
322498TALLY06AALFP8162H1ZX 19706.00
Match Portal & Tally
Cell Formulas
RangeFormula
E2:E32E2=IF(AND(B2<>B3,C2=C3,H2=H3),"Matched","")
 
Upvote 0
Columns 4, 5, 6 and 7 are also filled with some data which will not help to match. So I kept them blank in the image.
 
Upvote 0
Columns 4, 5, 6 and 7 are also filled with some data which will not help to match. So I kept them blank in the image.
you really need to get the terminology correct when you make requests, columns are letters, rows are numbers..................
you said column 5 already has data in it (i presume you mean column E) but say you want to place a formula in it...???
The below formula should do what you are asking but will show ROWS(the ones that go horizontally) 7 & 8 as a match as they meet ALL of your criteria (totals and ids match). as per post#14 why aren't they shown as a match in post#11 (original explanation).
Excel Formula:
=IF(MATCH(1,(H2=$H$2:$H$32)*(C2=$C$2:$C$32)*(B2<>$B$2:$B$32),0),"matched","")
 
Upvote 0
Solution
you really need to get the terminology correct when you make requests, columns are letters, rows are numbers..................
you said column 5 already has data in it (i presume you mean column E) but say you want to place a formula in it...???
The below formula should do what you are asking but will show ROWS(the ones that go horizontally) 7 & 8 as a match as they meet ALL of your criteria (totals and ids match). as per post#14 why aren't they shown as a match in post#11 (original explanation).
Excel Formula:
=IF(MATCH(1,(H2=$H$2:$H$32)*(C2=$C$2:$C$32)*(B2<>$B$2:$B$32),0),"matched","")
Sorry. Column E which is the 5th column is inserted to match, is blank where the formula has to be posted.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,525
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top