COUNTIF for Increasing Column

sk2018

New Member
Joined
Jul 7, 2018
Messages
26
Office Version
  1. 2016
Platform
  1. Windows
ABCDE
1AppleOrangeKiwiResponse 1Response 2
2=countif(D2:E2, "Apple")
=countif(D2:E2,"Orange")=countif(D2:E2,"Kiwi")AppleKiwi
3

<tbody>
</tbody>

Do refer to the above for your understanding.

Given that as time goes by, I will have data add on Column F, G, H, I and etc onwards.
Is there any way for me to count the number of Apple, Orange, Kiwi starting from Column D onwards.


I do not want to set it as Table as I have plenty of worksheets and need to distribute to others to use.
I'm not considering of using the range of D2:Z2 or whichever wide range as to avoid any deletion of columns that may take place.

Is there any formula that will be able to detect the last notblank columns and make it as the range?


Thanks.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
You could use this method;


MNOPQRSTU
1AppleOrangeKiwiGrapesCherriesSample PicklistResponse 1Response 2Response 3
210101AppleCherriesKiwi

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
M2=SUMPRODUCT(--(COUNTIF(responses,M$1)))
N2=SUMPRODUCT(--(COUNTIF(responses,N$1)))
O2=SUMPRODUCT(--(COUNTIF(responses,O$1)))
P2=SUMPRODUCT(--(COUNTIF(responses,P$1)))
Q2=SUMPRODUCT(--(COUNTIF(responses,Q$1)))

<tbody>
</tbody>

<tbody>
</tbody>

Workbook Defined Names
NameRefers To
responses=OFFSET(Sheet1!$S$2,,,,COUNTIF(Sheet1!$S$2:$XFD$2,"?*"))

<tbody>
</tbody>

<tbody>
</tbody>

Oh yes - this is working too.
Geez there are so many ways to solve the same problem in XLS.

Glad that the people here are very helpful too.
Thanks for the solution.
 
Upvote 0
Oh yes - this is working too.
Geez there are so many ways to solve the same problem in XLS.

Glad that the people here are very helpful too.
Thanks for the solution.

But not efficient because of array-processing and the volatile OFFSET function. Potentially wrong too when there are empty/blanks cells.
 
Upvote 0
Is there a scenario where we couldn't just use;

=COUNTIF($S$2:$XFD$2,M$1)?
 
Upvote 0

Forum statistics

Threads
1,216,144
Messages
6,129,120
Members
449,488
Latest member
qh017

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