formula based on date

Faysamantha

Board Regular
Joined
Oct 15, 2009
Messages
146
hi

i have been struggling for a couple of hours now. what i would like is a formula in Cell B1 of my finance spreadsheet which looks for the current date in column a and sum's the values in the corresponding columns (which are also forumlas)

Here is a mini version:

So today the bank balance is £1200, there is £500 outstanding on the loan and the credit card has £2000 on it.

£1200 - £500 - £2000 = £1300 is owed
=B3+C3+D3


A
B
C
D
1
Debt Today =
£1300
2
Date
Balance
Loan
Credit Card
3
17/07/2012
£1200
-£500
-£2000
4
18/07/2012
£1800
-£480
-£2105
5
19/07/2012
£2200
-£460
-£2500

<tbody>
</tbody>
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
1. can you show how you get 1300 for today (17th july) from your sample data?
2. Will there only ever be one row per date?
 
Upvote 0
=SUMPRODUCT(--(A3:A5=TODAY())*B3:D5)
or
array formula(confirm Control+shift+enter)
=SUM(IF(A3:A5=TODAY(),B3:D5))
 
Upvote 0
then Robert's answer will be fine (though you might want to prefix the whole formula with a negative operator).
 
Upvote 0
For what it's worth, Robert's SUMPRODUCT formula shouldn't need the extra calculations forced by the --
This should do the same job
=SUMPRODUCT((A3:A5=TODAY())*B3:D5)

An alternative is also:
=SUM(INDEX(B3:D5,MATCH(TODAY(),A3:A5,0),0))
 
Upvote 0
@ Peter_SSs,

Hello Peter,

Its been a while since we last had contact.

Nice observation and answers you have made here, but what exactly does the "--" in a Formula do? I have seen it a couple of times now, but have never used it.

Kind Regards
 
Upvote 0
@ Peter_SSs,

Hello Peter,

Its been a while since we last had contact.

Nice observation and answers you have made here, but what exactly does the "--" in a Formula do? I have seen it a couple of times now, but have never used it.

Kind Regards
it is called double unary operator and it forces conversion fo text (which is the return argument for a condition) in to a number because sumproduct only can work with a number or numbers.
 
Upvote 0

Forum statistics

Threads
1,216,058
Messages
6,128,538
Members
449,456
Latest member
SammMcCandless

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