Countif dynamic column based on target column

ncvnrjn

New Member
Joined
Jun 19, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hi there,
I have a planning file with week numbers in row 1, dates in row 2 and target values in column B (similar to the attached picture).

2023-06-19 14_35_03-Map2 - Excel.png


In a seperate sheet I'm trying to build a KPI that is: the percentage of planned amounts that are >= target amounts, per _week_, ignoring blanks.

Output should be something like:
Week 24: 57%
Week 25: 77%

I've been struggling to specify a dynamic range of 5 colums (all week 24, for example) and then do the countif or sumproduct.
Hope someone understands and can help.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
In future it would be helpful if you could post some data rather than an image.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

How about
Fluff.xlsm
ABCDEFGHIJKLMNOP
124242424242525252525
2
312346222454%
41244562569%
512557
6126547
71278211
812823
9129636
10130636
11131644
12132344
13133453
1413448
15135232
16136767
Home
Cell Formulas
RangeFormula
P3:P4P3=SUMPRODUCT(($D$3:$M$16>=$B$3:$B$16)*($D$3:$M$16<>"")*($D$1:$M$1=O3))/SUMPRODUCT(($D$1:$M$1=O3)*($D$3:$M$16<>0))
 
Upvote 0
Solution
That's just remarkable!
Functions exactly the way I want it too. Thanks a million.

I'll bear in mind the XL2BB Add-in for future posts, thank you.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,139
Messages
6,123,259
Members
449,093
Latest member
Vincent Khandagale

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