I am trying to autofill a column based on text in the same row, but the references will be different categories and I'm getting ERROR thrown at me - currency

I am trying to code a Google sheet for my mother's book keeping but I am hitting a wall. I have a number of categories that will be referenced and, depending on the category the monetary value will be changing.
Example.
Clerical $20/hr
Prop Mngt $35/hr
Admin $50/hr
Plus others I'm not aware of yet
I have tried this code =IF(SEARCH("Administration",$C8)>0,"$50") and it worked for the one keyword.
When I tried =IF(SEARCH("Administration",$C8)>0,"$50"),=IF(SEARCH("Clerical",$C8)>0,"$20") I was given ERROR.
How do I tell C8 to autofill D8 with the correct hourly rate? This will then feed D10 with =SUM(D8*E8) ???
Thank you for your help. I know just enough to know it's possible but not enough to grasp the issues I'm facing.

Try
=IF(not(iserror(SEARCH("Administration",$C8))),"$50",IF(not(iserror(SEARCH("Clerical",$C8))),"$20",""))
Another solution is to use this formula I think more understandable
=IFs(not(iserror(SEARCH("Administration",A1))),"$50",not(iserror(SEARCH("Clerical",A1))),"$20")

Related

Assitance with ImportXML in google sheets

I'm putting together a spreadsheet so I can keep track of items my store has for preorder and making it so it updates when stock levels change. I am trying to get it so my sheet tells me whether the webpage button says pre-order or add to basket. Sometimes this works and then other times it doesn't.
Here is the formula I have:
=IMPORTXML("https://www.smythstoys.com/uk/en-gb/video-games-and-tablets/gaming-merchandise/harry-potter-lumos-logo-light/p/209816","//html/body/div[7]/section/div/div/div[2]/div[1]/div[5]/div/div/div/div[2]/form/button")
This particular one seems to return an N/A. Outside of trying to teach myself, I don't know Importxml well or the details for HTML as to why this might or might not work.
I was also wondering if it were possible to only retrieve certain bits of text but not all of it. So, I have this:
=IMPORTXML("https://www.smythstoys.com/uk/en-gb/video-games-and-tablets/gaming-merchandise/harry-potter-lumos-logo-light/p/209816","//html/body/div[7]/section/div/div/div[2]/div[1]/div[5]/div/div/div/div[2]/form/div[1]/span[14]/table/tbody/tr/td[2]")
which returns "Out of Stock. Expected Stock August 2022". Is it possible to only retrieve the "August 2022" part of that text?
Thank you so much to anyone who can help.
To return the button
=index(importxml(url,"//button[#id='addToCartButton']"),1,1)
To get only the availability date
=regexextract(IMPORTXML(_______________),".*: (.*)")

Sum durations if they meet a criteria? (Google sheets)

I'm trying to create a dynamic dashboard for staff to track the total amount of time they've worked for our program. They fill out a form with start/end time and denote if it's work that's eligible for our program to pay them for it. I'm building a dashboard where they can see how many extended hours they've racked up over the course of the school year because we have limits on how many hours they can earn.
I'm including an editable
copy of my spreadsheet to show what I've got so far... I'd like to add up any durations in column E that have a "Yes" in Column F (which is all of them at the moment) and have that sum sit in cell C5. But all I can get it to do is sum up to zero, and I can visibly see that it should be more than zero. I've tried changing the format of the cell(s) too, but it's still zero.
Any help or ideas are greatly appreciated! And I'm always trying to learn and improve, so if you know how to do this and don't mind explaining to me how the solution works, I'd also really appreciate that so that I can keep getting better at Sheets. :)
Thanks in advance!
This is because the numbers in column J (in Data sheet) are stored as text. Either enter them instantly as numbers or use the helper column where they are converted by the formula e.g. =VALUE(J1)
Played around with it enough that I got it finally!
=SUM(ARRAYFORMULA(if(C8:C="Yes",E8:E-D8:D,0)))
Thanks for helping me troubleshoot and think it through!

LOOKUP Function won't output correct value

I'm trying to create an Activity tracker for a game. However, I'm trying to use the LOOKUP function to track activity throughout 3 different sheets. However, the LOOKUP function does not seem to be outputting the correct value. LINK: https://docs.google.com/spreadsheets/d/1tdq6oeEFjgxJg6FXvSH2ZmkgRlHaFiD5aycjvezfNvc/edit?usp=sharing
If you look at Activity sheet, E2:E52, you should understand that it's outputting the wrong value(At least based on what I'm reading on the google docs).
I've tried converting this over to one sheet to see if that was the problem, however, it didn't work there either, I tried being more inclusive of the exact letter and number combination and that didn't help either.
I expect it to output the Attacks column for the username based on the Activity1 sheet.
Any help would be greatly appreciated.
PS: I tagged excel as it does the same exact thing on excel, however it gives slightly different values. I'm very confused.
use VLOOKUP instead:
=ARRAYFORMULA(IFERROR(VLOOKUP(D2:D,
{Activity1!C:D; Activity2!C:D; Activity3!C:D}, 2, 0)))

The data in my Google Sheet is not appearing in the correct cell

I am trying to create a spreadsheet to simplify our account returns. I am using a variety of named ranges to make life easier. I have created a test sheet which automatically copies the inputted cost to its appropriate category.
I am having a strange issue where the cell I am expecting to see the data in is incorrect. I am wondering if the 2 data validation lists I have created could be causing the issue. I had originally copy / pasted from an old sheet but as I wondered if some strange formatting may have been carried over which is causing the issue I have since manually entered all data to remove this as a potential cause.
https://docs.google.com/spreadsheets/d/1KC8FsVNQZfWtey5TvPDxCxvDhRrFVHdsbDJWmZu73wg/edit#gid=0
This is the test sheet in question. The cost for entries Test 9 & Test 10 should be in the Info Books and Stationary sections retrospectively but they are ending up in the wrong places.
I am not a spreadsheet expert so I apologise if I am missing something blatently obvious. A friend advised me to ask on Stackoverflow after many hours lost to this problem.
Thanks in advance for any help you may be able to give.
Use the third parameter in vlookup set to false (or zero)
=IF(VLOOKUP(companyOfPurchase,suppliersAndCategories,2, 0) = typeOfPurchase,totalOfReceipt,"")
and see if that works?

How to combine dynamic ranges with OFFSET and INDIRECT functions?

I'm trying to create a formula that uses a dynamic range to link to the different tabs. It would then return the last 12 values before a blank cell, based on the value in the Header Column.
The tricky part is the data in each tab is of different sizes, so I thought it might have to incorporate either Offset(Blank()),0,-12) or something of the sort. I've tried a lot of different things, and this is the latest effort:
=Index(Indirect(A2&"!A9:AK9"),match("Conversions",Indirect(A2&"!A9:AK9"),)0,-12)
Edit: First post, sorry for the confusion. My goal is to make a large dashboard that has a dynamic chart using our monthly metrics. (I'm leaving the chart setup for another day)
The data varies in such, some have columns A:K, while some have a larger range of A:AK , etc. (With A:A being text). Since I've posted this, I have had some success by using Filter(), but the problem I'm not sure how to solve is finding the last 12 values before a blank cell.
Example of Data 1
Example of Data 2
Hopefully this helps explain the situation and I appreciate everyone for help.

Resources