Why does the MID function require an argument for the number of characters?
Added by Steven H.
Step 1
The MID function is used to extract a specific substring from a larger string. It allows you to specify where to start the extraction and how many characters to extract. Show more…
Show all steps
Your feedback will help us improve your experience
Kirsty Gledhill and 76 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Use the LEFT function in cell C5 to return the text "Employee number " from the "Text Stamp Phrase" in cell C2. Notice the space after number. a. Use a reference to the location of the "#" symbol in cell C4 as the "[num_chars]" argument. b. Since the "#" symbol is one character past the text you want to return, you will need to adjust the "[num_chars]" argument by subtracting 1 from the reference to cell C4.
Kirsty G.
You are responsible for monitoring employees' entry into your company's server room. To complete this task, you need to review a log of when employees entered the room. The log is a little bit difficult to read. It contains: An employee number (column B). A computer generated stamp that records when the employee swiped their ID card to enter the room (column C). Ultimately, you want to create the "Text Stamp" in column K that completes the phrase, "Employee number # entered the server room at HH:MM:SS today." for each row of the log. You will replace "#" with the employee number and "HH:MM:SS" with the appropriate time stamp. Use time and text functions to complete the tasks below. 2.1 Use the LEN function in cell C3 to calculate the length of the "Text Stamp Phrase" in cell C2. 2.2 Use the SEARCH function in cell C4 to determine the position of the "#" symbol in the "Text Stamp Phrase" in cell C2. 2.3 Use the LEFT function in cell C5 to return the text "Employee number " from the "Text Stamp Phrase" in cell C2. Notice the space after number. Use a reference to the location of the "#" symbol in cell C4 as the "[num_chars]" argument. Since the "#" symbol is one character past the text you want to return, you will need to adjust the "[num_chars]" argument by subtracting 1 from the reference to cell C4. 2.4 Use the SEARCH function in cell C6 to determine the position of the characters " HH" (notice the space before the first H) in the "Text Stamp Phrase" in cell C2. 2.5 Use the MID function in cell C7 to return the text " entered the server room at " (notice the spaces at the beginning and end of the phrase) from the "Text Stamp Phrase" in cell C2. Use a reference to the location of the "#" symbol in cell C4 as the "start_num" argument. Since the "#" symbol is 1 character before the text you want to return, you will need to adjust the "[start_num]" argument by adding 1 to the reference to cell C4. Use the difference between the location of the "#" symbol (cell C4) and the characters " HH" (cell C6) as the "num_chars" argument. 2.6 Use the RIGHT function in cell C8 to return the text " today." from the end of the "Text Stamp Phrase" in cell C2. The "[num_chars]" argument for your function is 7 since there are seven characters in the text " today." (including the space at the beginning). 2.7 Use the HOUR function in cell D12 to calculate the "Hour" portion of the "Entry Swipe" found in cell C12. Copy and paste the function down to complete the "Hour" column of the table. 2.8 Use the MINUTE function in cell E12 to calculate the "Minute" portion of the "Entry Swipe" found in cell C12. Copy and paste the function down to complete the "Minute" column of the table. 2.9 Use the SECOND function in cell F12 to calculate the "Second" portion of the "Entry Swipe" found in cell C12. Copy and paste the function down to complete the "Second" column of the table. 2.10 Use the CONCAT function in cell J12 to combine the text in cells G12, H12, and I12 to create a "Time Stamp". Notice that the syntax for the "Time Stamp" is "HH:MM:SS". You will need to insert the ":" symbol between "Hour" and "Minute" and between "Minute" and "Second". Hint: you should have five arguments for your function. arguments 2 and 4 should be the ":" symbol. Copy and paste your function to complete the "Time Stamp" column of the table. 2.11 Use the CONCAT function to combine the text in cells C5, B12, C7, J12, and C8 (in that order) to create the "Text Stamp" in cell K12. The "Text Stamp" in cell K12 should read "Employee number 18 entered the server room at 00:53:02 today." Use absolute cell reference when necessary so that the function can be reused. Copy and paste your function to complete the "Text Stamp" column of the table.
Supreeta N.
A function N = f(x) gives the number of miles driven in a day. What does f(Monday) = 500 mean?
Manisha S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD