INDIRECT, TEXT, and DATEVALUE function

dpatete

New Member
Joined
Nov 30, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I am trying to reverse engineer this formula:

=INDIRECT(TEXT(DATEVALUE($A$3),"mmmm")) Hours

I am unsure why "Hours" is at the end of the formula. The formula references a date in A3 (October 2022), but I am unsure why it needs to be in the "mmmm" format. The result of the formula in the cell is 177. I think it may be trying to figure out how many working hours (8 hours a day Monday-Friday) are in the referenced month, but I want to understand exactly how this formula works.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Welcome to the Board!

Can you show us an example where it is being used, where we can see both the formula and the underlying data?

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

Also, do you have any VBA code in this workbook?
If so, can you post it?
 
Upvote 0
This is my guess:

- The user cannot get the month name, maybe because it is in a text format rather than date format, so he is converting the text into a date with DATEVALUE(A3)
- with TEXT "mmmm", he is converting the date into spelled out month name.
- with INDIRECT he is looking at a cell that is named with that month's name. If you look at top left corner there is a box where it shows the selected cell address. If you click on the dropdown next to it, you should see October (and probably other months as well)

That's what I think.
 
Upvote 0
This is my guess:

- The user cannot get the month name, maybe because it is in a text format rather than date format, so he is converting the text into a date with DATEVALUE(A3)
- with TEXT "mmmm", he is converting the date into spelled out month name.
- with INDIRECT he is looking at a cell that is named with that month's name. If you look at top left corner there is a box where it shows the selected cell address. If you click on the dropdown next to it, you should see October (and probably other months as well)

That's what I think.
This is actually really helpful! You are pretty much spot on. I found the cell that INDIRECT is referencing by using the drop down. Thank you!!
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,078
Latest member
skydd

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