Return Value if Equal to a List

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
923
Office Version
  1. 365
Hi,

I have the following table:

Book1
CDEFG
2Leave TypeLeaveTask 1Task 2Check
3ALAL10100
4EL520
5MC 620
Sheet1
Cell Formulas
RangeFormula
G3:G5G3=IF(D3=C3:C5,0,SUM(E3:F3))
Dynamic array formulas.


In column G, I am trying to return as 0 if any of the value in column D equals to any of the value in column C. The first cell G3 seems to return the right result but cell F4 and F5 seems to return the incorrect value.

The correct results are as follows:
Book1
CDEFG
8Leave TypeLeaveTask 1Task 2Check
9ALAL10100
10EL55
11MC 66
Sheet1


Appreciate any help to rectify the formula.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
How about
+Fluff 1.xlsm
CDEFG
1
2Leave TypeLeaveTask 1Task 2Check
3ALAL10100
4EL55
5MC 66
Primary
Cell Formulas
RangeFormula
G3:G5G3=MMULT((D3:D5<>C3:C5)*E3:F5,{1;1})
Dynamic array formulas.
 
Upvote 0
Solution
Hi,

Not sure, would this also work:

Book3.xlsx
CDEFG
1
2Leave TypeLeaveTask 1Task 2Check
3ALAL10100
4ELMC50
5MC66
Sheet1008
Cell Formulas
RangeFormula
G3:G5G3=IF(COUNTIF(C$3:C$5,D3),0,SUM(D3:F3))
 
Upvote 0
Too late to Edit, typo in my post above, change to this:

Excel Formula:
=IF(COUNTIF(C$3:C$5,D3),0,SUM(E3:F3))
 
Upvote 0
Hi Fluff and jtakw,

Thank you for your solution. Appreciate your patience and valuable time. Both worked. Have a great day ahead..?
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,757
Messages
6,126,695
Members
449,331
Latest member
smckenzie2016

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