ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help using the DAY() function (https://www.excelbanter.com/excel-discussion-misc-queries/257927-help-using-day-function.html)

Don

Help using the DAY() function
 
=IF(DAY(B3:B30)21,N4,0) I'm trying to use this formula to check in
column B if a date of the 22nd of the month was entered (manually). If it
was, then the cell (O4 in this instance) would be equal to the contents of
cell N4, which is a numeric value. Otherwise, cell O4 would be equal to zero
(0). The problem I'm having is that the range (B3:B30) is not being checked
- it doesn't work. Furthermore, B4 is the only cell that allows this formula
to work. Can't figure that one out. Do I need to rewrite the formula? Any
help would be appreciated. Thanks!

Max

Help using the DAY() function
 
Think you could fashion it like this, using sumproduct
In O4: =IF(SUMPRODUCT(--(DAY(B3:B30)21))0,N4,0)
Success? hit YES below
--
Max
Singapore
---
"Don" wrote:
=IF(DAY(B3:B30)21,N4,0) I'm trying to use this formula to check in
column B if a date of the 22nd of the month was entered (manually). If it
was, then the cell (O4 in this instance) would be equal to the contents of
cell N4, which is a numeric value. Otherwise, cell O4 would be equal to zero
(0). The problem I'm having is that the range (B3:B30) is not being checked
- it doesn't work. Furthermore, B4 is the only cell that allows this formula
to work. Can't figure that one out. Do I need to rewrite the formula? Any
help would be appreciated. Thanks!


Don

Help using the DAY() function
 
Hi Max. I tried this and it did not work. All it displayed was FALSE. I
tried to enter 3-22-2010 in B5, B8, and B4. All it said was FALSE. Any
other suggestions?


"Max" wrote:

Think you could fashion it like this, using sumproduct
In O4: =IF(SUMPRODUCT(--(DAY(B3:B30)21))0,N4,0)
Success? hit YES below
--
Max
Singapore
---
"Don" wrote:
=IF(DAY(B3:B30)21,N4,0) I'm trying to use this formula to check in
column B if a date of the 22nd of the month was entered (manually). If it
was, then the cell (O4 in this instance) would be equal to the contents of
cell N4, which is a numeric value. Otherwise, cell O4 would be equal to zero
(0). The problem I'm having is that the range (B3:B30) is not being checked
- it doesn't work. Furthermore, B4 is the only cell that allows this formula
to work. Can't figure that one out. Do I need to rewrite the formula? Any
help would be appreciated. Thanks!


Fred Smith[_4_]

Help using the DAY() function
 
When I enter Max's formula it works.

Possible problems a
-- You didn't enter the formula exactly as shown (if you are getting FALSE
as a result, this is most likely your problem)
-- Your dates are text, rather than true Excel dates (what happens when you
format the cell to General?)

Regards,
Fred

"Don" wrote in message
...
Hi Max. I tried this and it did not work. All it displayed was FALSE. I
tried to enter 3-22-2010 in B5, B8, and B4. All it said was FALSE. Any
other suggestions?


"Max" wrote:

Think you could fashion it like this, using sumproduct
In O4: =IF(SUMPRODUCT(--(DAY(B3:B30)21))0,N4,0)
Success? hit YES below
--
Max
Singapore
---
"Don" wrote:
=IF(DAY(B3:B30)21,N4,0) I'm trying to use this formula to check
in
column B if a date of the 22nd of the month was entered (manually). If
it
was, then the cell (O4 in this instance) would be equal to the contents
of
cell N4, which is a numeric value. Otherwise, cell O4 would be equal
to zero
(0). The problem I'm having is that the range (B3:B30) is not being
checked
- it doesn't work. Furthermore, B4 is the only cell that allows this
formula
to work. Can't figure that one out. Do I need to rewrite the formula?
Any
help would be appreciated. Thanks!



Bernard Liengme[_2_]

Help using the DAY() function
 
The IF function does not expect to test a range, just a single condition.
You have an array formula so it needs to be 'array entered'
Double click the cell to get into Edit mode; now commit the formula with
CTRL+SHIFT+ENTER
Excel will place the formula within curly braces { } and you will get what
you want

For more on this topic:
http://www.cpearson.com/excel/array.htm .
http://www.emailoffice.com/excel/arrays-bobumlas.html
http://office.microsoft.com/en-us/as...872901033.aspx

best wishes
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Don" wrote in message
...
=IF(DAY(B3:B30)21,N4,0) I'm trying to use this formula to check in
column B if a date of the 22nd of the month was entered (manually). If it
was, then the cell (O4 in this instance) would be equal to the contents of
cell N4, which is a numeric value. Otherwise, cell O4 would be equal to
zero
(0). The problem I'm having is that the range (B3:B30) is not being
checked
- it doesn't work. Furthermore, B4 is the only cell that allows this
formula
to work. Can't figure that one out. Do I need to rewrite the formula?
Any
help would be appreciated. Thanks!



Don

Help using the DAY() function
 
MAX and Bernard - Just wanted to say "THANK YOU". Max was correct with his
answer. But Bernard told me how to complete it with the CSE. After putting
Maz's formula in an array, it worked perfectly! Thank you again.

Don


"Bernard Liengme" wrote:

The IF function does not expect to test a range, just a single condition.
You have an array formula so it needs to be 'array entered'
Double click the cell to get into Edit mode; now commit the formula with
CTRL+SHIFT+ENTER
Excel will place the formula within curly braces { } and you will get what
you want

For more on this topic:
http://www.cpearson.com/excel/array.htm .
http://www.emailoffice.com/excel/arrays-bobumlas.html
http://office.microsoft.com/en-us/as...872901033.aspx

best wishes
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Don" wrote in message
...
=IF(DAY(B3:B30)21,N4,0) I'm trying to use this formula to check in
column B if a date of the 22nd of the month was entered (manually). If it
was, then the cell (O4 in this instance) would be equal to the contents of
cell N4, which is a numeric value. Otherwise, cell O4 would be equal to
zero
(0). The problem I'm having is that the range (B3:B30) is not being
checked
- it doesn't work. Furthermore, B4 is the only cell that allows this
formula
to work. Can't figure that one out. Do I need to rewrite the formula?
Any
help would be appreciated. Thanks!


.


Max

Help using the DAY() function
 
Welcome, glad to hear you got going. But I'd like to clarify this bit. The
beauty/ease of using sumproduct is that you don't have to array enter it
(CSE), just normal ENTER will do, 99.999%* of the time. That I didn't mention
to CSE it in my response reflects this. If CSE is required, I'd have
mentioned it in my response. The sumproduct should have worked as advertised
with just normal ENTER. If it didn't work, it's probably due to one of the
reasons explained by Fred (my thanks to Fred for the follow up). Could you
re-examine it and revert further here? It works for me (and Fred), no reason
why it shouldn't work for you. Try copying the expression direct from my
posting & paste it directly into the formula bar over there.

*The only exception where CSE is needed with sumproduct is where TRANSPOSE
is involved
--
Max
Singapore
---
"Don" wrote:
MAX and Bernard - Just wanted to say "THANK YOU". Max was correct with his
answer. But Bernard told me how to complete it with the CSE. After putting
Maz's formula in an array, it worked perfectly! Thank you again.

Don



Don

Help using the DAY() function
 
Hello again Max. Once again, you were right. I removed the CSE from the
formula and it worked flawlessly. Thank you again, Max. I hope you are
around when I need help again.

Don


"Max" wrote:

Welcome, glad to hear you got going. But I'd like to clarify this bit. The
beauty/ease of using sumproduct is that you don't have to array enter it
(CSE), just normal ENTER will do, 99.999%* of the time. That I didn't mention
to CSE it in my response reflects this. If CSE is required, I'd have
mentioned it in my response. The sumproduct should have worked as advertised
with just normal ENTER. If it didn't work, it's probably due to one of the
reasons explained by Fred (my thanks to Fred for the follow up). Could you
re-examine it and revert further here? It works for me (and Fred), no reason
why it shouldn't work for you. Try copying the expression direct from my
posting & paste it directly into the formula bar over there.

*The only exception where CSE is needed with sumproduct is where TRANSPOSE
is involved
--
Max
Singapore
---
"Don" wrote:
MAX and Bernard - Just wanted to say "THANK YOU". Max was correct with his
answer. But Bernard told me how to complete it with the CSE. After putting
Maz's formula in an array, it worked perfectly! Thank you again.

Don



Max

Help using the DAY() function
 
Thanks for feeding back. Glad you got it working the way it should.
--
Max
Singapore

"Don" wrote in message
...
Hello again Max. Once again, you were right. I removed the CSE from the
formula and it worked flawlessly. Thank you again, Max. I hope you are
around when I need help again.

Don





All times are GMT +1. The time now is 05:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com