Need number of days for each month of the year!

Hi,


So on Numbers for Mac I'm trying to make a spreadsheet where the user can select the month via a drop down menu, and then depending on the month selected, the table will know whether it is 28, 30 or 31 nights. It is a calculation for a rental property on a per night basis.


I have made the drop down for the months of the year but how can I link each month to the number of nights? So i kind of want to say: If 'January' is selected, then multiply by 31 and so on for each other month. Any help appreciated. Thanks

Posted on Jan 3, 2021 11:47 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 3, 2021 1:30 PM

Make a lookup table listing the months by name in column A and the number of days in that month listed in column B.


Then use LOOKUP, VLOOKUP or INDEX and MATCH to search for the monthname in column A and return the number of days from that row in column B.


This will require editing the list for leap years, then reversing the edit for the following year.



Formul shown as entered in selected cell. Filled down the last cell in column C le larger table.


Text version of formula for copy & paste to formula editor.

IF(B2="","",VLOOKUP(B2,Days::A:B,2))


Regards,

Barry


3 replies
Question marked as Top-ranking reply

Jan 3, 2021 1:30 PM in response to DJSammy

Make a lookup table listing the months by name in column A and the number of days in that month listed in column B.


Then use LOOKUP, VLOOKUP or INDEX and MATCH to search for the monthname in column A and return the number of days from that row in column B.


This will require editing the list for leap years, then reversing the edit for the following year.



Formul shown as entered in selected cell. Filled down the last cell in column C le larger table.


Text version of formula for copy & paste to formula editor.

IF(B2="","",VLOOKUP(B2,Days::A:B,2))


Regards,

Barry


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Need number of days for each month of the year!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.