I have an excel sheet with different columns with all have the value Yes or No. I want in my last column a formula that extract a result of all the previous columns.
If all the values are No, the result has to be No
Is one or more values Yes, the result should be Yes
I don't know which formula I can use for that. Can someone help?
=IF(COUNTIF(A1:C1,"Yes") > 0,"Yes","No")
Change A1:C1 to the range of interested columns
Try using OR function. you can get syntax https://support.office.com/en-us/article/OR-function-7d17ad14-8700-4281-b308-00b131e22af0
You just need nested OR functions for each column. Here's a sample with 3 columns:
=OR(A1="yes",OR(B1="yes",C1="yes"))
For additional columns, add another OR around the existing, with one argument testing the this code, and then add your new column as the other argument.
Related
I am not so into Excel and I am finding the following difficulty trying to adapt a pre-existing formula to a new requirement.
Basically I have this original formula (workiong fine):
=SUMPRODUCT((D2:D7)*(B2:B7="BUY"))/SUMPRODUCT((G2:G7)*(B2:B7="BUY"))
This basically calculate an avarange price checking that the value of the B column is "BUY" (basically to exclude when the row is a SELL row). It works fine.
Now I have to change the previous formula excluding also all the row having the H column having value different from "CC". I have try in this way:
=SUMPRODUCT((D2:D7)*(B2:B7="BUY" AND H2:H7="CC"))/SUMPRODUCT((G2:G7)*(B2:B7="BUY" AND H2:H7="CC"))
Basically I tried to add an AND condition checking if the H column value is CC. But it is not working. It give me a syntax error when I try to insert this second version of my forumula.
Why? What is wrong? What am I missing? How can I fix my formula?
AND is used AND(crit1,crit2) not crit1 AND crit2.
AND will not work in this case.
Use * instead:
=SUMPRODUCT((D2:D7)*(B2:B7="BUY")*(H2:H7="CC"))/SUMPRODUCT((G2:G7)*(B2:B7="BUY")*(H2:H7="CC"))
For AND either use this logic: AND(B2:B7="BUY",H2:H7="CC") or (B2:B7="BUY")*(H2:H7="CC") in the second one * stands for AND, but as pointed out by Scott Craner in array formulas (such as SUMPRODUCT) you have to use *.
I have been working on an IF statement where there are multiple answers but I can't seem to get the formula to work. The If statement is going to look at two columns of data and should pull back the first NUMBER. Sometimes the first column will say "#N/A N/A" in which case the formula should look to the second column and pull that NUMBER. If both columns say "#N/A N/A" then I would like the answer to be "NR".
In another scenario I will have three columns of data. I would like the formula to pick up the first number in the columns no matter what follows. Again, if all three columns say "#N/A N/A" I would like the answer to be "NR".
I will attach two examples of what I am talking about. Here is the formula I have now but I can't seem to get it to work:
=IF(ISBLANK(B3),"",IF(D3="#N/A N/A",$D3,$D4))
Unfortunately, this formula isn't taking into account if D3 is actually a number. It also doesn't account for if both D3 and D4 are "#N/A N/A".
Any help would be greatly appreciated.
Thanks,
Here is the example :
This allows the use of many columns without the need for multiple nested ifs.
It will return the first column that is not #N/A N/A:
=IFERROR(INDEX(3:3,,AGGREGATE(15,6,COLUMN(D3:E3)/(D3:E3<>"#N/A N/A"),1)),"NR")
So to do more columns simple change both the D3:E3 to the range desired. The 3:3 should match the row being searched.
You can check each cell (from left to right) and return the first instance of a numerical value using a combination of IF & ISNUMBER
Checking 2 Columns
=IF(ISNUMBER(D3),D3,IF(ISNUMBER(E3),E3,"NR"))
Checking 3 Columns
=IF(ISNUMBER(D3),D3,IF(ISNUMBER(E3),E3,IF(ISNUMBER(F3),F3,"NR")))
In the sheet1 i have a table called working days of the countries as shown in the below image.
In the Sheet2 i have 10 columns in that based on the country and month by referring the this table i am trying to populate the values, When i tried doing by Vlookup the first row alone getting populated, but in the second row the header from F1:T1 is getting changed to F2:T2 so rest of the cells showing as #NA.
Anyone can you please give a solution for my issue. Here is the formula i have used.
=VLOOKUP(I1,Sheet1!F2:T7,MATCH(Sheet2!M1,Sheet1!F1:T1,0))
Thanks in Advance.
You are missing the symbol $ to lock the ranges, and the false condition to match exact values in the VLOOKUP.
It should be like:
=VLOOKUP(I1,Sheet1!$F$2:$T$7,MATCH(M1,Sheet1!$F$1:$T$1,0),0)
Or instead of VLOOKUP use HLOOKUP like:
=HLOOKUP(M1,Sheet1!$F$1:$T$7,MATCH(I1,Sheet1!$F$2:$F$7,0),0)
In general, combining the INDEX and MATCH functions is a superior option to VLOOKUP. For example, =INDEX(Sheet1!F:F,MATCH(Sheet2!M1,Sheet1!F1:T1,0)). This allows you to go left-to-right or right-to-left as well.
Snip for Index Match functions Using Vlookup won't work here because in the 2nd table you are repeating the country, unlike the first table. Use a combination of index match function, this is little trickier than the vlookup but it will fulfill your requirements.
Since I don't have the exact table you shared so I created a table on my end and sharing the snip here.
I need to sum the values of several columns, if other cells in the same row match a predefined criteria. The working formula for only 3 columns is the following:
=SUM(SUMIFS(‘Sheet1'!W:W; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!X:X; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4");SUMIFS(‘Sheet1'!Y:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4"))
I will need to use the formula for several cells (and sum more than 10 columns per time) and I will need to change the columns manually, so I need the same formula in the following way:
=SUMIFS(‘Sheet1'!W:Y; ‘Sheet1'!$B:$B;"Sales";‘Sheet1'!$C:$C;">=4")
,but currently this formula leads to a "#VALUE!" error. The reason for that is (I assume) the use of multiple columns "W:Y"
Can you suggest a workaround?
I would suggest to use SUMPRODUCT rather than SUMIFS. You can build something like that :
=SUMPRODUCT((B1:B1048575="Sales")*(C1:C1048575>=4)*(W1:Y1048575))
The downside of SUMPRODUCT is that you can't use a whole column (for example you cannot write SUMPRODUCT((B:B="Sales"...)), this would generate an error).
Hope this helps.
I suggest you add a column with the sum('sheet1'!W:Y) and then use sumifs on this columns. It is a two step way but it will give the result you expect
Here's what I have :)
=SUM(SUMIFS('WTD Raw'!R:R,'WTD Raw'!E:E,"Kindle-Customer Care",'WTD
Raw'!J:J,"Week27",'WTD Raw'!H:H,'PassRate | July'!G8) + SUMIFS('WTD
Raw'!R:R,'WTD
Raw'!E:E,"Kindle-Technical Support",'WTD Raw'!J:J,"Week27",'WTD
Raw'!H:H,'PassRate | July'!G8))
Instead of using ";" use the Mathematical Operators for it to work.
I need to check in excel whether a column (b1:b300) contains only 2 specific values 1,-24. How can check this using formulas only. Please help
You can use a VLOOKUP, and depending if you search for ANY of the two or BOTH of the two, you combine two VLOOKUP as needed.
=VLOOKUP(arg,range,1,FALSE) will yield #N/A if not found, which can be further analyzed using the =ISNA() function
It is simple:
=COUNTIFS(B1:B300,"<>1",B1:B300,"<>-24")