'run excel formula only if date is in a specific range

I have a formula that works for an entire column.

I would like to run this same formula but ONLY if column C is between today and 7 days before today.

This is my formula :

=(ROUND(COUNTIF(graFabrication!O:O,"0")/COUNTIF(graFabrication!O:O,">-1")*100,1)&"%")

I just can't figure it out



Solution 1:[1]

So did this as you provide so little data to work with:

enter image description here

To save you typing, here is the formula I created as text so you can copy:

IF(($D$1-C3)>7,"too old","do_this")

Then, and this bit I cannot test:

IF(($D$1-C3)>7,"too old",(ROUND(COUNTIF(graFabrication!O:O,"0")/COUNTIF(graFabrication!O:O,">-1")*100,1)&"%")

Is your function added.

And if the 7 days is inclusive you will need greater than or equal to.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Solar Mike