I have multiple columns as follows
A B C D Outcome
Y Y
N N
N N
Y Y
My outcome is in the column E. If the cell is filled, I want to see it in the outcome column. If not I want to see a blank cell. I tried my best, but I could do it. Is there a simple function to do it. Thanks for your help.
There are a number of ways to accomplish this. One would be:
// Copy this down
In Cell E2: =IF(COUNTA(A2:D2)=0,"",CONCATENATE(A2,B2,C2,D2))
Try :
=A2&B2&C2&D2
Related
Screenshot
I am trying to create sum conditions using a checkbox with 3 columns. I am just a beginner using google sheet any inputs and help will be much appreciated.
My forumla is: =SUM(M2189:N2189)-L2189+I2189,SUM(O2189,I2189)
If cell M and N is checked sum M and N - the total amount in L cell + I cell
Now I am getting an error on this part
If cell O is selected it should return 0 and the value from column I.
Thanks a lot.
Use This pattern. And I think if you can compllete it.
=SUMIF(CheckboxRange,true,SumRange)
I need to do a match/index search in reverse right to left
each cell with have an x i need do go from right to left find what column the x is in and report the position so can then go to the top of that column and pull that data. I basically need to find out what column is the last X in.
A B C D E F G H I J
State 27-Aug 28-Aug 29-Aug 30-Aug 31-Aug 1-Sep 2-Sep 3-Sep 4-Sep
VI X X X X X X
in above example 3 rows 10 columns if i want to see that the last X is in Column G(7) then i use the index to go to that column(7), row A to 1-sep as the answer.
This will find the last cell with a value, regardless of value:
=INDEX($A$1:$J$1,MATCH("zzz",A2:J2))
If you want to find the last X, regardless of what is or is not in any of the other cells, then use this formula:
=INDEX($A$1:$J$1,AGGREGATE(14,6,COLUMN(A2:J2)/(A2:J2="X"),1))
One note: this is an array type formula and will be slower than the prior formula. If you only have one it will not make a difference. If you have hundreds you will see a difference.
But if you have other text strings after the X and you want the X then it is the way to go.
try out
=INDEX(1:1,1,COUNTIF(2:2,"X")-1)
Assuming there are no gaps within the stream of X's
=MATCH(2,IF(A2:J2="x",1,FALSE))
This is an array formula.
This will give you last position of x. Then, like you indicated, put the result inside INDEX function and you should be good. I like this option because i can put any condition inside the if statement, like >0.
I am trying to get a formula that will work for the following:
if Cell A contains X, then Cell B = Cell C +1, but if Cell A contains Y, then Cell B = Cell C +2, but if Cell A contains Z then Cell B = Cell C +3
any help greatly appreciated
You may be able to use SWITCH :
https://support.office.com/en-us/article/SWITCH-function-47ab33c0-28ce-4530-8a45-d532ec4aa25e
A simple IF statement can be written as below...
=IF(A2="X",C2+1,IF(A2="Y",C2+2,IF(A2="Z",C2+3,"")))
There are various other approaches to get the desired output. One of them is like below...
=IFERROR(CHOOSE(MATCH(A2,{"X","Y","Z"},0),C2+1,C2+2,C2+3),"")
Consider:
=LOOKUP(A1,{"X","Y","Z"},{1,2,3})+C1
EDIT#1:
To use LOOKUP(), the input vector must be in alphabetic order.
I'm creating a report where I need to count all entries where (column a = x or column b = x or column c = x) and (column d <> x or y or z)
I'm open to any solutions scripted or expression.
Thank you.
_t
=sumproduct(NOT(NOT(((A:A="X")+(B:B="X")+(C:C="X"))))*((D:D<>"X")*(D:D<>"Y")*(D:D<>"Z)))
This is with the assumption that an entire row is considered the entry not each individual cell.
This can be computationally intensive with full column reference. Better if used over a defined range.
You can use the following array formula, just adjust the variables "X, Y, Z" to whatever you criteria you need it to be and change the range to fit your range of data.
=COUNTIF(A1:A10,"X")+COUNTIF(B1:B10,"X")+COUNTIF(C1:C10,"x")+SUM((D1:D10<>"X")*(D1:D10<>"Y")*(D1:D10<>"Z"))
You have to press CTRL + SHIFT + Enter to calculate this array formula, will not work with a standard enter.
I'm trying to write an If or SumIf to calculate(sum) totals for x , y and z individually.
I could use a simple sum formula but these are thousands of columns and x and y and z are populated randomly. I tried using a range by sorting colA but its a temporary solution and not what I am looking for.
I need something like:
If COL A has 'X' then add values corresponding to X in COL B
example:
COLA COLB ....... colx
x 1
x 2
x 1
y 3
x 3
z 3
x 4
I tried looking up other answers for similar questions but could not find the right one that works for me.
If you want to sum multiple columns based on a value in a single column you could use SUMPRODUCT like this
=SUMPRODUCT((A2:A100="x")*B2:X100)
There can't be text in the sum range, B2:X100, otherwise you get an error - if you want to allow text in that range use this version:
=SUMPRODUCT((A2:A100="x")*ISNUMBER(B2:X100),B2:X100)
Maybe (difficult to tell from the question):
=sumif(A:A,"=x",B:B)
Another answer could be that you create a pivot table of the database. Insert>Pivot Table>Select your table range. Then from there, you would put the column heading you wanted sorted into the row criteria, and then sum the x1's and y'1s.
I am assuming you want to obtain subtotals for each column and each letter, as in the figure below.
If so, enter in B12 the formula
=SUMPRODUCT(($A$2:$A$8=$A12)*(B$2:B$8))
Copy and paste into B12:C14. It is easy to adapt to slightly different arrangements.
I apologize if my question was vague. This is my first time working with if and sumif formulas in Excel.
This is what I was looking for: =sumif(A:A,"=x",B:B).
Thank you Pnuts.