In Google Sheets, how can you use the IF statement using the output of a cell's formatted value?
I've created a Google Sheet with a date value in B1. The cell is formatted using the date format. B1 is then copied across to the right so that it increments the days of the month.
In B2, based on the B1 date, I want to display the day value (ie Thu, Fri, Sat etc.). Similarly to the first step, I set the date format under Format > Number > More formats > More date and time formats, then from the select box, choose the day and I want to display the "Tue" date format.
Then in B8, I want to display an amount of 30 every Thursday, otherwise, show 0.
This is where it doesn't work. Does it seem like the rendered cell's value can't be used in an IF statement? My desired output is that every the value in row 2 is a 'Thu' display 30.
As a side note, I jumped on Google support and asked this same question. Even though they are technical support, I thought I'd give them a try anyway, after all, I am paying for GSuite.
This is the formula they came back to me with: =if(B2=B1, "30", "0").
Of course, this formula will work in B8, because B2 is equal to B1 in the actual cell value, it doesn't take into account the formatted cell value. This formula will fail the output we need as it will always display 30 instead of only then row 2 is 'Thu'.
So essentially, is there a function in Google Sheets for a rendered cell value? Or another solution around this?
Note: I do NOT want to use any scripting to get this to work.
try it like this:
=IF(TEXT(B2, "ddd")="Thu", 30, 0)
Please try and copy across to suit:
=30*(WEEKDAY(B1)=5)
No IF, but shorter.
Related
I am trying to display the outcome scores on one Excel sheet into another Excel sheet based on the outcome name and course.
If the text in Sheet1!C2=communication and Sheet1!E2=Comm 2010, then display Sheet1!D2 on Sheet2!B3.
If the text in Sheet1!C4=information* and Sheet1!E4=Commm 3000, then display Sheet1!1D4 on Sheet2!C5.
Need to be able to use Wildcard when checking the text.
If the text in Sheet1!C6=communication and Sheet1!E6=Comm2010, but there is no number in Sheet1!D6, leave Sheet2!B5 blank
I have played around with a few different IF AND formulas, but I can't get the data displayed correctly.
Right now, I am building a pivot table from the data in Sheet1, then taking the table and formatting it to match the table on Sheet1 then using =IF(Pivot!C7="","",Pivot!C7). This works, but building a pivot table for each student and then formatting it to match Sheet1 is a time drain.
I'm really hoping there is a better way to do this.
Thank you!
Since you are compiling outcomes on a per-student basis and not in total it is safe to use the SUMPRODUCT() function:
The formula below is used in B3
=SUMPRODUCT((Sheet1!$E$2:$E$6=Sheet2!B$1)*(Sheet1!$C$2:$C$6=Sheet2!$A3)*(Sheet1!$D$2:$D$6))
and can be copied across and down throughout B3:C4
The formula used in B5 is different, because of the 'wildcard criterion'
=SUMPRODUCT((Sheet1!$E$2:$E$6=Sheet2!B$1)*(LEFT(Sheet1!$C$2:$C$6,11)="Information")*(Sheet1!$D$2:$D$6))
(unless you are using Microsoft 365, having the formula directly suppress 0 values essentially entails doubling it in length so, as an alternative, given the small output range, a custom-number format has been implemented, which effectively doesn't display 0 in a cell where that is the formula result)
I am learning Power BI Desktop. I have a project already loaded for which I have created a
pie chart.
As you can see, the data is currently divided into two years: 2022 and 2021.
I also have data for previous years that I want to include in the chart. Unfortunately, none of these years has a high number. So I want to group them all into an "Other" category.
I've already tried using the RANKX function as described here (where I copied and pasted the formula from the comment and replaced the field name with my own) and here (where I went through the article step by step using my own field names). I used the exact format shown in both the comment and the article:
Rank = RANKX('Table','Table'[Percent],,DESC,Dense)
(Table is the table name I am using and Percent is the column I am trying to rank.)
When I added the new column to a table, though, PowerBI automatically gave me a sum calculation. This calculation gave me a 1 in each column. When I asked it not to give me a sum, it said it could not display the visual and took me back to the calculation screen.
EDIT: Thanks for your help Kevin! This is the table I tried to draw from. I am an idiot sometimes.
EDIT 2: Now I am trying to use a different field in the formula:
Rank = RANKX('FactClaimActivity','FactClaimActivity'[DirectIncurredLoss_ITD])
(This is the original field that I tried to base Percent on)
My table looks like this. (Yes, I know that 2016, 2017, 2019 and 2020 have negative values and 2014 and 2015 have $0 values. I just want to show what the data is.)
EDIT 3: This time I am also getting an error when I type in the formula, which says "A single value for column 'DirectIncurredLoss_ITD' in table 'FactClaimActivity' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
I do not understand why it wants a single result for a formula that ranks the data points based on this field. That seems like it defeats the whole purpose of the formula.
Yet when I use the formula, I get the same result as last time! This column is in the Fixed decimal number format, and it does have many different values.
EDIT: I've found the answer
New Category = IF('FactClaimActivity'[Rank]<=2,'FactClaimActivity'[LossYear],"Other")
The formula will help you get the correct result.
I'm having a problem with what should be a very simple calculated field. I have two conversion numbers, let's say a "7 day click" number and a "1 day view" number.
I'm trying to create a calculated field that simply adds these two numbers together.
Yet, this is the result I'm getting:
As we can see, the all conv value is not simply adding the other two columns. What am I doing wrong in the calculated field?
Thanks in advance, as I've spent way too much time trying to figure out such a simple thing
EDIT:
It appears that, when I add a new grouping, that the problem consists of null values in one of the two columns. example:
How can I change the calculated field to account for this? In the data warehouse, these blank values are just null values.
Thanks
I tried out what You did and it works fine for me:
QuickSight Table
Calculated field
I suppose there is something wrong with Your dataset.
Probably the granularity of the date field is not day but something else like hour and the calculated field tries to add eg. 11 Jun 10:00 + 12 Jun 11:00.
This is of course wrong. You need to add 11 Jun + 12 Jun.
Probably You need to extract the day of Yours date field.
to my question about the calculated field, this was what I used that worked.
ifelse( isNull({conv_1dv}), 0, {conv_1dv}) + ifelse(isNull({conv_7dc}),0,{conv_7dc})
I want to fill the chart with data I pull via PHP from an API. For some reason I have issues to format the date correctly so the chart currently shows no bars with my data.
A data set from the random data looks like this:
{"t":1494806400000,"o":"35.19","h":"36.79","l":"33.94","c":"36.15"}
One from me like this:
{"t":1591092000,"o":"33.3900","h":"34.2000","l":"32.4100","c":"34.1900"}
I see that there are three 0 missing in mine, but even when I add them it's not working.
I have also checked the dates at https://www.unixtimestamp.com/index.php to find a difference but the original dates is outputted as 01/05/49229 # 12:00am (UTC) which looks very odd to me.
Can anyone tell me in which format the date needs to be? d M Y h:i:s is what I currently do in php, but it neither works without the seconds.
5-months later:
I would recommend looking into the Luxon Library to get the values for t,
https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html
Other wise I do believe its Year Month Day hours:minutes:seconds
I am new to Open office how to create Series of Date in Openoffice
For example
If I am entering the date as 04/APR/2013 (2 months) this has to increase in each below column. The most important thing is if it is saturday or sunday i need it in different color or some differentiate.
Could any one help me on this
Thanks & Regards
Maha
Assuming column A, put the date in A1, then put the following formula in A2;
=A1 + 1
Copy the formula as far down the column as you want.
I'm not sure how you want to indicate weekends. You can use some combination of WEEKDAY and STYLE.
Thank you for choosing a date that is independent of locale (ie dd = MM).
I am assuming capitalisation of the whole of the month short name is not critical as arranging that would complicate meeting the rest of your requirements.
First (say in A1) enter:
4/4/13
then Format > Cells > Numbers Date and 31/Dec/1999, and click OK.
Then click on the fill handle (the small black square at the bottom right-hand corner of the cell) of cell A1 and drag down to suit (for two months about 60 rows).
Next select your 60 or so cells, Format > Conditional Formatting… and for Condition1 select Formula is and enter:
WEEKDAY(A1;4)>4
then select your style of choice and click OK.