Currently, the formula in cell F7 is: =FILTER(C3:C7, COUNTIF($F$3:$F$4, $B$3:$B$7))
However, that formula can only return "Pen" and "Paper". But now I would like it to be when cell G3 is "Price" then 5 and 2 will be returned; if cell G3 is "Item" then "Pen" and "Paper" will be returned
May I know how should I modify the formula in cell F7?
You can have a look at the screenshot attached below to understand my question better. Thanks in advance.
=FILTER(FILTER($B$3:$D$7,$B$2:$D$2=$G$3),COUNTIF($F$3:$F$4, $B$3:$B$7))
It first filters the range to where the column header equals the value in G3, then it filters that column with your countif results.
Related
Is there a way to create a formula in one cell that will change the value in another cell based on some criteria, without scripting? Example: cell a1 contains a numerical value. cell b1 contains a value from a drop-down list, say, "YES,NO". If cell b1 is set to "YES" I want to remove (set to zero) the value in cell a1. What I'd like to do is have a formula in cell c1 that interrogates b1 and sets the value in a1 accordingly. Is the only way achieve this writing code and using setValue?
you cant remove it without a script. you can visually hide it in various ways. if the A1 is subject of further sum (as in your case per your comment) the sum formula can be always altered to reflect desired output. example:
if your formula is
=SUM(A1, C5, D22)
you can do
=SUM(IF(B1="YES", 0, A1), C5, D22)
Use the following on the cell you need the calculation (or zero) on:
=IF (B1="YES",0,SUM(A:A))
Using the given formula, you would do the SUM calculation for the whole Column A if the value on B1 is "YES", if not, then a 0 would be placed on the cell you put the formula on.
Goal: Return the date difference shown in cell C5 to cell C4, and the date difference shown in C6 to cell C5 etc.
Currently I am getting the date difference of cells with the letter "s" but it is being shown in the next corresponding row with "s"
Formula currently in C2 then dragged down is as shown below:
=IFERROR(IF(B2="s",A2-INDIRECT("A"&LOOKUP(2,1/($B$1:$B1="s"),ROW($B$1:$B1))),"-"),"n/a")
and this is how my sheet currently looks
Thanks in advance.
The following formula will look for the next "s", as long as it is within 1000 rows of the current one. Put this in C2:
=IF(B2="s",INDEX(A3:A1002,MATCH("s",B3:B1002,0))-A2,"-")
Then populate down
To avoid the last "s" giving a result of #N/A you can wrap the whole thing in an IFERROR statement:
=IFERROR(IF(B2="s",INDEX(A3:A1002,MATCH("s",B3:B1002,0))-A2,"-"),"-")
I need to insert a value to a cell in excel using formula in another cell.
Say
A1 = "Test"
B1 = formula to insert A1 to C1
C1 = A1
Can I write a formula in B1 to insert value in C1?
I don't need any formulas in C1.
If Yes, What should be the formula?
If there it is next to the cell AND has no value in B2, it is possible, otherwise it is not.
Use Split()
Split(CONCATENATE("Text for B1#Sperator$$",A1),"#Sperator$$",FALSE)
It really depends.
EDIT
Out dated. Only works in google sheets.
Without using VBA or formulas in column C you can't achieve this.
A simple solution using formulas:
In cell C1, paste the following formula and drag it down:
=IF(B1=1;A1;"")
So if the content of cell B1 is equal to 1, your cell at column C will display the respective value of the same row at column A.
I'm trying to calculate the total from D2 to D17 only if the cells between C2 to C17 contain the number "9". I tried to use the formula =SUMIF(C2:C17,9,D2:D17), but it wouldn't work!
The odd part is that if I put in another criteria such as "4" or 50", it would return the sum. It just doesn't work with some numbers.
Here's a screenshot of the
SUMIF if I put 9 as my criteria
Thank you for any help
Look like the formula is fine, but you are summing the value "0" to the highlighted cell containing the formula, because D17 = 0, and that cell corresponds the "9" value - so the sum you get is, as expected, 0.
I am encountering a small problem in excel.
I am making a sheet in excel using various formulas but got stuck at a point.
My query is:
I have a "Name" in Cell say B2.
On the other sheet, there is a table which consists of lots of names.
I need a formula in cell F2 which will look the value in Cell B2 in the table and if it matches, then cell F2 will show the result by multiplying cell D2 and E2.
If the value is not located in a table, then the result will be 0.
Please help me out in it as i have tried both vlookup and index match.
Thanks
Salman Khan
Enter this into cell F2:
=IF(COUNTIF(Sheet2!$A$2:$A$6,B2)=1, D2*E2, 0)
This assumes that your list of names is located in Sheet2 in the range A2:A6 (hence just 5 names in my example).
Make certain that you use absolute cell referencing in Sheet2 when you copy this formula to the other cells in your F column.
Im not on excel now, but ill give you the algorythm yo solve your problem. I would like to assume you know the ff functions that i will mention.
If( vlookup(B2, sheet2!A:A, 1, 0) != "#N/A", D2*E2, "Not found" )
Im not sure if that is the exact formula but thats the algo fir that..