Countif formula

ALT719

New Member
Joined
Aug 20, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi! I have the formula below. I want the formula to count the data from E17 to Q17, even if I add a new column. I am trying to calculate the last 13 weeks of data at all times and do not want the cell references to change when a new column is added. In other words, I add a column and the formula shifts to F17 to R17... but I want it to always be E17 to Q17, even if another column is added. I have tried various versions of adding INDIRECT to the statement and it always returns an error. I am not sure what I'm missing. Any help would be greatly appreciated!

=COUNTIF(E17:Q17,"Yes")/COUNTA(E17:Q17)
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Perhaps
Excel Formula:
=COUNTIF($E$17:$Q$17,"Yes")/COUNTA($E$17:$Q$17)
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=LET(a,TAKE(DROP(D17:R17,,1),,13),COUNTIFS(a,"Yes")/COUNTA(a))
 
Upvote 0
Did you try the formula that I suggested, as it is non-volatile & so more efficient?
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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