Formula to get match if difference is +1 / -1

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello formula experts
I am trying to match Portal with Tally and get the matched rows. If the amount has a difference of about +1 or -1 then also it should consider as a match. With this formula I am getting an exact match, but not the amounts which have a difference of +1 or -1. I need your expertise to edit the formula to get all the matches with a formula, even if there is a difference not more than +1 or -1.
I had posted the same query on Excel Ask & Answer a few days back but the query remains unsolved.
Excel Ask & Answer

Query to match portal with Tally.xlsx
ABCDEFGH
1LineAS perID No.DRemarksFG Amount
22PORTAL29EULXB5486E1XMMatched21,600.00
33PORTAL29EULXB5486E1XM#N/A58,205.00
44PORTAL29EULXB5486E1XM#N/A13,000.00
56PORTAL29EULXB5486E1XM#N/A27,553.00
648PORTAL33EEFFB2045M1XN#N/A20,768.50
774PORTAL29EWXXM8712Q1XF#N/A2,761.00
887PORTAL36ECQXH8295Q1XF#N/A21,000.00
988PORTAL36ECQXH8295Q1XFMatched7,080.00
10103PORTAL27EEECI7904G1XN#N/A1,069.08
11115TALLY29EULXB5486E1XMMatched21,600.00
12133TALLY29EULXB5486E1XM#N/A58,204.00
13138TALLY29EWXXM8712Q1XF#N/A2,761.50
14139TALLY36ECQXH8295Q1XF#N/A21,381.00
15143TALLY33EEFFB2045M1XN#N/A20,768.00
16146TALLY29EULXB5486E1XM#N/A12,999.50
17164TALLY29EULXB5486E1XM#N/A27,555.00
18167TALLY36ECQXH8295Q1XFMatched7,080.00
Portal + Tallly Match
Cell Formulas
RangeFormula
E2:E18E2=IF(MATCH(1,(H2=$H$2:$H$23200)*(C2=$C$2:$C$23200)*(B2<>$B$2:$B$23200),0),"Matched","")
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Replace (H2=$H$2:$H$23200) with (ABS(H2-$H$2:$H$23200)<=1)
If you mean like this
=IF(MATCH(1,(ABS(H2-$H$2:$H$23200)<=1))*(C2=$C$2:$C$23200)*(B2<>$B$2:$B$23200),0),"Matched","")
It is not accepting it. Or do you mean to say that I have to replace all the ranges....?
 
Upvote 0
I tried this too but it ain't working.
Rich (BB code):
=IF(MATCH(1,(ABS(H2-$H$2:$H$23200"<"&$H2+0.5,$H$2:$H$23200,">"&$H2-0.5)=1,*(C2=$C$2:$C$23200)*(B2<>$B$2:$B$23200),0),"Matched","")
 
Upvote 0
What is this portion supposed to do and why are the inequalities text symbols?

(ABS(H2-$H$2:$H$23200"<"&$H2+0.5,$H$2:$H$23200,">"&$H2-0.5)=1
 
Upvote 0
What is this portion supposed to do and why are the inequalities text symbols?

(ABS(H2-$H$2:$H$23200"<"&$H2+0.5,$H$2:$H$23200,">"&$H2-0.5)=1
I had a CF formula which I just tried to edit to get the amounts with the difference. But was not able to. Not so good at these kind of formulas.
 
Upvote 0
As I said above in the OP formula replace (H2=$H$2:$H$23200) with (ABS(H2-$H$2:$H$23200)<=1)
Oops.... I forgot to press control shift enter. It is perfect. Thanks mikerickson. ?
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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