IF isnumber and search funtion

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Please help me to correct this formula. The cells marked Yellow in column B should display Contra in column G. I am getting correct answer in some cells, but not all. I have used this function: =IF(ISNUMBER(SEARCH($F$2:$F$5,B2)),E2,D2)
 

Attachments

  • Query 2.png
    Query 2.png
    45.3 KB · Views: 13

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How about
Excel Formula:
=IF(SUM(IFERROR(SEARCH($F$2:$F$5,B2),0)),E2,D2)
 
Upvote 0
Cannot manipulate data in a picture. Please use XL2BB to upload your sample data.
 
Upvote 0
I believe the problem is that it's finding a blank (space) and that's a number.
 
Upvote 0
How about
Excel Formula:
=IF(SUM(IFERROR(SEARCH($F$2:$F$5,B2),0)),E2,D2)
Only 2 entries are matching with your formula, same result with my formula too. . But it has to match 10 entries and show contra
 
Upvote 0
In that case please post some sample data using the XL2BB add-in.
 
Upvote 0
In that case please post some sample data using the XL2BB add-in.
I have tried many times but I am not able to upload. Do you have any link of a video how to upload a xl2bb file here.? I always get a message that "Table information successfully saved in the clipboard. You can paste it in the forum post".
 
Upvote 0
Query.xlsx
ABCDEFGH
1LineDESCRIPTIONTYPEANSWERMY ACCOUNTS
2100400021000024880 To : 004000550000027010 S37619917 S37713671ReceiptContra27010Contra
3200400055000027010 To : 004000040000010310 S21651085 S21701269PaymentContra24880Payment
4300400055000027010 To : 004000040000010310 S44718572 S44737529PaymentContra10310Contra
5400400055000027010 To : 004000040000010310 S701466 S1325421PaymentContra24350Payment
6500400055000027010 To : 0040000400017794 S28638584 S28666428PaymentPaymentPayment
7600400055000027010 To : 00400021000024880 S18487986 S18960977PaymentContraPayment
8700400055000027010 To : 00400021000024880 S19659009 S20043975PaymentContraPayment
9800400055000027010 To : 00400021000024880 S20145180 S21200445PaymentContraPayment
10900400055000027010 To : 0040000400006497 S21614497 S21626834PaymentPaymentPayment
111000400055000027010 To : 0040000400006497 S35919089 S35944589PaymentPaymentPayment
121400400055000027010 To : 00400004000024350 S62051922 S62074670PaymentContraPayment
131500400055000027010 To : 00400004000024350 S80244419 S80297918PaymentContraPayment
141600400055000027010 To : 00400004000024350 S81929291 S83148077PaymentContraPayment
151739110021000012345 To : 00400055000027010 S24961461 S25692368ReceiptContraReceipt
161839110021000012345 To : 00400055000027010 S25321639 S27240183ReceiptContraReceipt
171939110021000012345 To : 00400055000027010 S42377353 S42850086ReceiptContraReceipt
182039110021000012345 To : 00400055000027010 S48211167 S49452768ReceiptContraReceipt
192139110021000012345 To : 00400055000012345 S70685132 S72972466ReceiptReceiptReceipt
202239110021000012345 To : 00400055000012345 S9482650 S9677308ReceiptReceiptReceipt
21
Sheet1
Cell Formulas
RangeFormula
G2:G20G2=IF(SUM(IFERROR(SEARCH($F$2:$F$5,B2),0)),E2,D2)
 
Upvote 0
Query.xlsx
ABCDEFGH
1LineDESCRIPTIONTYPEANSWERMY ACCOUNTS
2100400021000024880 To : 004000550000027010 S37619917 S37713671ReceiptContra27010Contra
3200400055000027010 To : 004000040000010310 S21651085 S21701269PaymentContra24880Payment
4300400055000027010 To : 004000040000010310 S44718572 S44737529PaymentContra10310Contra
5400400055000027010 To : 004000040000010310 S701466 S1325421PaymentContra24350Payment
6500400055000027010 To : 0040000400017794 S28638584 S28666428PaymentPaymentPayment
7600400055000027010 To : 00400021000024880 S18487986 S18960977PaymentContraPayment
8700400055000027010 To : 00400021000024880 S19659009 S20043975PaymentContraPayment
9800400055000027010 To : 00400021000024880 S20145180 S21200445PaymentContraPayment
10900400055000027010 To : 0040000400006497 S21614497 S21626834PaymentPaymentPayment
111000400055000027010 To : 0040000400006497 S35919089 S35944589PaymentPaymentPayment
121400400055000027010 To : 00400004000024350 S62051922 S62074670PaymentContraPayment
131500400055000027010 To : 00400004000024350 S80244419 S80297918PaymentContraPayment
141600400055000027010 To : 00400004000024350 S81929291 S83148077PaymentContraPayment
151739110021000012345 To : 00400055000027010 S24961461 S25692368ReceiptContraReceipt
161839110021000012345 To : 00400055000027010 S25321639 S27240183ReceiptContraReceipt
171939110021000012345 To : 00400055000027010 S42377353 S42850086ReceiptContraReceipt
182039110021000012345 To : 00400055000027010 S48211167 S49452768ReceiptContraReceipt
192139110021000012345 To : 00400055000012345 S70685132 S72972466ReceiptReceiptReceipt
202239110021000012345 To : 00400055000012345 S9482650 S9677308ReceiptReceiptReceipt
21
Sheet1
Cell Formulas
RangeFormula
G2:G20G2=IF(SUM(IFERROR(SEARCH($F$2:$F$5,B2),0)),E2,D2)
I never knew it was so easy to upload a XL2BB File...
 
Upvote 0
=IF(ISNUMBER(IFERROR(SEARCH($F$2:$F$5,B15),0)),E15,D15)
with this formula I am getting the contra entries but with some additional ones also.
Query.xlsx
ABCDEFG
1LineDESCRIPTIONTYPEANSWERMY ACCOUNTS
2100400021000024880 To : 004000550000027010 S37619917 S37713671ReceiptContra27010Contra
3200400055000027010 To : 004000040000010310 S21651085 S21701269PaymentContra24880Contra
4300400055000027010 To : 004000040000010310 S44718572 S44737529PaymentContra10310Contra
5400400055000027010 To : 004000040000010310 S701466 S1325421PaymentContra24350Contra
6500400055000027010 To : 0040000400017794 S28638584 S28666428PaymentPaymentPayment
7600400055000027010 To : 00400021000024880 S18487986 S18960977PaymentContraContra
8700400055000027010 To : 00400021000024880 S19659009 S20043975PaymentContraContra
9800400055000027010 To : 00400021000024880 S20145180 S21200445PaymentContraContra
10900400055000027010 To : 0040000400006497 S21614497 S21626834PaymentPaymentPayment
111000400055000027010 To : 0040000400006497 S35919089 S35944589PaymentPaymentPayment
121400400055000027010 To : 00400004000024350 S62051922 S62074670PaymentContraContra
131500400055000027010 To : 00400004000024350 S80244419 S80297918PaymentContraContra
141600400055000027010 To : 00400004000024350 S81929291 S83148077PaymentContraContra
151739110021000012345 To : 00400055000027010 S24961461 S25692368ReceiptContraContra
161839110021000012345 To : 00400055000027010 S25321639 S27240183ReceiptContraContra
171939110021000012345 To : 00400055000027010 S42377353 S42850086ReceiptContraContra
182039110021000012345 To : 00400055000027010 S48211167 S49452768ReceiptContraContra
192139110021000012345 To : 00400055000012345 S70685132 S72972466ReceiptReceiptReceipt
202239110021000012345 To : 00400055000012345 S9482650 S9677308ReceiptReceiptReceipt
21
Sheet1
Cell Formulas
RangeFormula
G2:G20G2=IF(ISNUMBER(IFERROR(SEARCH($F$2:$F$5,B2),0)),E2,D2)
 
Upvote 0

Forum statistics

Threads
1,215,504
Messages
6,125,183
Members
449,212
Latest member
kenmaldonado

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