##### Board Regular
Hi all

Have been using:

Code:
``=SUM(Journal!\$BY\$9:\$BY\$504)-(SUMIF(Journal!\$J\$9:\$J\$504,">31/01/2014",Journal!\$BY\$9:\$BY\$504)+SUMIF(Journal!\$J\$9:\$J\$504,""<1/1/"2014",Journal!\$BY\$9:\$BY\$504))``

I have to remember to change the year each year....any ideas how to overcome this?

The user inputs the year in "Journal!V4" on another sheet if it's of any help.

Thanks for any help in advance.

Mark

### Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Which date range do you need to exclude whether from 1st Jan '14 to 31st Jan '14? Can you pls make it clear pls?

Try

=SUM(Journal!\$BY\$9:\$BY\$504)-(SUMIF(Journal!\$J\$9:\$J\$504,">"&DATE(Journal!V4,1,31),Journal!\$BY\$9:\$BY\$504)+SUMIF(Journal!\$J\$9:\$J\$504,"<"&DATE(Journal!V4,1,1),Journal!\$BY\$9:\$BY\$504))

But you could also try the following alternatives, the first of which requires Excel 2007 or later.

=SUMIFS(Journal!\$BY\$9:\$BY\$504,Journal!\$J\$9:\$J\$504,">="&DATE(Journal!V4,1,1),Journal!\$J\$9:\$J\$504,"<="&DATE(Journal!V4,1,31))

=SUMPRODUCT(--(TEXT(Journal!\$J\$9:\$J\$504,"mmm-yyyy")="Jan-"&Journal!V4),Journal!\$BY\$9:\$BY\$504)

Try

=SUM(Journal!\$BY\$9:\$BY\$504)-(SUMIF(Journal!\$J\$9:\$J\$504,">"&DATE(Journal!V4,1,31),Journal!\$BY\$9:\$BY\$504)+SUMIF(Journal!\$J\$9:\$J\$504,"<"&DATE(Journal!V4,1,1),Journal!\$BY\$9:\$BY\$504))

But you could also try the following alternatives, the first of which requires Excel 2007 or later.

=SUMIFS(Journal!\$BY\$9:\$BY\$504,Journal!\$J\$9:\$J\$504,">="&DATE(Journal!V4,1,1),Journal!\$J\$9:\$J\$504,"<="&DATE(Journal!V4,1,31))

=SUMPRODUCT(--(TEXT(Journal!\$J\$9:\$J\$504,"mmm-yyyy")="Jan-"&Journal!V4),Journal!\$BY\$9:\$BY\$504)

Thanks Peter, the third option was perfect.

Mark

Thanks Peter, the third option was perfect.
Glad it worked for you. Thanks for letting us know.

Replies
1
Views
371
Replies
2
Views
401
Replies
3
Views
434
Replies
2
Views
210
Replies
2
Views
603

1,217,760
Messages
6,138,446
Members
450,137
Latest member
HANHAN

### 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.

### Which adblocker are you using?

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

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