How to count in excel with a variable data as condition

Elsave

New Member
Joined
Apr 27, 2014
Messages
1
Hi,

I'm not sure how or where to find answer to the next question

I want to count how many cell are valid to a conditional value.

Let me explain using a table

4112406
573603
3171014
413004
533604
4132433
3151351

<colgroup><col style="width: 79px"><col width="41"><col width="55"><col width="68"></colgroup><tbody>
</tbody>

I want to know how many cell in the last column have a value 2 less than the value in the first column. Without use of an extra column.

I think something with countif(D:D;....
But what do I use as criteria???

Does anyone know???

Thanks
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Elsave,

Welcome to MrExcel.

Assuming a data range of A1:D1000 (You may edit the rows to suit your max data range)

Perhaps try....

=SUMPRODUCT(--($A$1:$A$1000-$D$1:$D$1000=2))

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

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