Date function not working when embedded

Ronderbecke

Board Regular
Joined
Oct 4, 2017
Messages
73
I have embedded into a formula a simple function for using sumproduct and in the middle of the function is this:
=Date(2022,12,1)
It works fine like that but when I have 2022,12,1 in cell E4 I can't just use =DATE(E4) and have tried using text function and indirect function and nothing is working. I know this is probably something stupid I am missing but how do you change out what I have in date and use data from a cell that looks literally the exact same?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Why not enter the date as a real date, rather than text.
 
Upvote 0
Why not enter the date as a real date, rather than text.
=SUMPRODUCT(IF('Copy of Calculator'!$D2:$D100=A4,IF('Copy of Calculator'!$B2:$B100-DAY('Copy of Calculator'!$B2:$B100)+1=Date(2022,12,1),'Copy of Calculator'!$F2:$F100)))

How do you mean enter a real date? That's the whole function, would changing the date format alleviate the issue?
 
Upvote 0
If you want to use E4 for the date, then you need to enter it as a proper date in whatever format your date system is.
So for the UK that would be 01/12/2022
 
Upvote 0
If you want to use E4 for the date, then you need to enter it as a proper date in whatever format your date system is.
So for the UK that would be 01/12/2022
Ah, I tried that and received this error:
ErrorWrong number of arguments to DATE. Expected 3 arguments, but got 1 arguments.
 
Upvote 0
If you want the date in a cell then use
Excel Formula:
=SUMPRODUCT(IF('Copy of Calculator'!$D2:$D100=A4,IF('Copy of Calculator'!$B2:$B100-DAY('Copy of Calculator'!$B2:$B100)+1=E4,'Copy of Calculator'!$F2:$F100)))
 
Upvote 0
Solution
If you want the date in a cell then use
Excel Formula:
=SUMPRODUCT(IF('Copy of Calculator'!$D2:$D100=A4,IF('Copy of Calculator'!$B2:$B100-DAY('Copy of Calculator'!$B2:$B100)+1=E4,'Copy of Calculator'!$F2:$F100)))
Ah, I see what I did wrong when I originally tried that. Like I said, something stupid. Sorry, fixed.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,200
Messages
6,123,601
Members
449,109
Latest member
Sebas8956

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