# Formula switching from IF TRUE to IF FALSE

1. ## Formula switching from IF TRUE to IF FALSE

Hi there!

I am trying to find the average distance of the distances in column A if that trip falls between dates of Period 1. (Please see attached file).
This is my formula: =AVERAGE(IF((\$A:\$A>=G18)*(\$A:\$A<=H18), \$C:\$C)) and it works!

The issue is when I copy this formula to follow dates of Period 2, then Period 3 etc it provides a 0 as the answer which is incorrect.
This is my formula: =AVERAGE(IF((\$A:\$A>=G19)*(\$A:\$A<=H19), \$C:\$C))

As you can see the only thing that has changed is cells in column G and H which denotes the dates that I need to average calculation to fall between.

2. ## Re: Formula switching from IF TRUE to IF FALSE

P.S if you download the file, the formula in question is located in J4 to J15

3. ## Re: Formula switching from IF TRUE to IF FALSE

Use below formula: (See attachment for details)

=AVERAGE(IF((\$A:\$A>=G18)*(\$A:\$A<=H18), \$C:\$C)) and Ctrl+Shift+Enter

Hope it helped you!!

4. ## Re: Formula switching from IF TRUE to IF FALSE

Thank you!

Can you explain why Ctrl+Shift+Enter works? because the formula itself is exactly the same.

5. ## Re: Formula switching from IF TRUE to IF FALSE

You have used array formula, hence it needs be entered with "Ctrl+Shift+Enter"

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1