ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I convert text to numbers in excel? (https://www.excelbanter.com/excel-programming/381552-how-do-i-convert-text-numbers-excel.html)

JSM52272

How do I convert text to numbers in excel?
 
I have a work schedule that shows "D" for working days, and "N" for working
nights. At the end of the month, there is a cell that shows "Total
Days/Nights Worked" for that particular month. How do create a formula that
says, "If there is a "D" or a "N" in these particular cells, then show a
value of "1" for each, and add them up. In other words, if you worked 6 days
and 9 nights for the month of January, I'd like for the total to show 15.
Thanks a million to anyone who can help.

DavidUp

How do I convert text to numbers in excel?
 
Hi there

Number of nights can be determined by =COUNTIF(A1:A10,"N")
Number of days by =COUNTIF(A1:A10,"D")
thus the total is =COUNTIF(A1:A10,"N")+COUNTIF(A1:A10,"D")

"JSM52272" wrote:

I have a work schedule that shows "D" for working days, and "N" for working
nights. At the end of the month, there is a cell that shows "Total
Days/Nights Worked" for that particular month. How do create a formula that
says, "If there is a "D" or a "N" in these particular cells, then show a
value of "1" for each, and add them up. In other words, if you worked 6 days
and 9 nights for the month of January, I'd like for the total to show 15.
Thanks a million to anyone who can help.


Bob Phillips

How do I convert text to numbers in excel?
 
=COUNTIF(A:A,"D")

etc.

or together

=SUM(COUNTIF(A:A,{"D","N"}))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JSM52272" wrote in message
...
I have a work schedule that shows "D" for working days, and "N" for

working
nights. At the end of the month, there is a cell that shows "Total
Days/Nights Worked" for that particular month. How do create a formula

that
says, "If there is a "D" or a "N" in these particular cells, then show a
value of "1" for each, and add them up. In other words, if you worked 6

days
and 9 nights for the month of January, I'd like for the total to show 15.
Thanks a million to anyone who can help.





All times are GMT +1. The time now is 09:26 AM.

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