Related
I am trying to put a nested IF, AND and Vlookup formula. I want formula to return the value "0.17" in cell F3 if cell D3 has text "pasha" and B3 is not equal to cells mentioned in vlookup formula but its returns zero instead of showing 0.1. Please guide, TIA
=IFERROR(IF(AND(D3="Pasha",VLOOKUP(B3,G70:H78,2,0)<>B3),0.17,IF(VLOOKUP(B3,$B$69:$B$89,1,0)=B3,0.15,"")),0)
enter image description here
You may want to replace
VLOOKUP(B3,G70:H78,2,0)<>B3)
(Excel will unsuccessfully try to match B3 value with values from G column range while it contains different type of data:“Pasha”)
with
NOT(ISNUMBER(MATCH(B3,H70:H78,0)))
And feel free to adjust the second VLOOKUP accordingly.
So, how about this:
You need to to sort the vlookup() but the process for testing the conditions is there.
I have a typical book index in a spreadsheet that goes like this:
I need Excel to recognize the different integers in the same cell and add a constant each one of them.
Let's say the constant is 5
The result should be like this:
I couldn't get excel to recognize the different values in a cell.
My two cents, assuming Excel ms365:
Formula in B1:
=BYROW(A1:A3,LAMBDA(a,LET(X,TEXTSPLIT(a,", "),TEXTJOIN(", ",,IFERROR(X+C1,X)))))
Or, if no access to TEXTSPLIT(), then use:
=BYROW(A1:A3,LAMBDA(a,LET(X,FILTERXML("<t><s>"&SUBSTITUTE(a,",","</s><s>")&"</s></t>","//s"),TEXTJOIN(", ",,IFERROR(X+C1,X)))))
Or, if no access to BYROW(), you'd have to drag the following:
=LET(X,FILTERXML("<t><s>"&SUBSTITUTE(A1,",","</s><s>")&"</s></t>","//s"),TEXTJOIN(", ",,IFERROR(X+C$1,X)))
Not sure if this could be done smoothly and without using long and complex formulas.
Why don't you try to split the cell into multiple columns (Data > Data Tools > Text To Columns > Delimited and select Comma as delimiter). Once you have all different values is separate columns, it would be easy to apply formulas and add the constant.
After that, you could use CONCATENATE formula to merge texts and numbers back to single value in a single column.
Hope this helps.
I would separate the text and each value into separate cells, then use & to combine into the format you want, something like so:
=A1&", "&B1+G1&", "&C1+G1&", "&D1+G1
where A1 contains "Trauma" and B1 contains 15, C1 contains 17 and D1 contains 25. G1 holds the constant 5.
See
This is what I have tried,
Formula Applicable To Only O365 Beta Channel (Insiders).
• Formula used in cell B1
=TEXTJOIN(", ",,TEXTBEFORE(A1,", ",1),TEXTSPLIT(TEXTAFTER(A1,", ",1),", ")+5)
Or, if you are not using the above Excel Version, but using either Excel 2019, 2021 or Regular O365, then,
• Formula used in cell B1
=TEXTJOIN(", ",,LEFT(A1,FIND(",",A1)-1),IFERROR(
FILTERXML("<a><b>"&SUBSTITUTE(A1,", ","</b><b>")&"</b></a>","//b")+5,""))
Edit
One improvised approach:
=TEXTJOIN(", ",,TEXTBEFORE(A1,", ",1),IFERROR(TEXTSPLIT(A1,", ")+5,""))
You can also accomplish this task quite easily with Power Query.
I have several cells that calculate totals from a single cell from multiple worksheets, in this case "Y3" from each of the sheets that are in Week, where n is an integer from 1 through 10:
=SUMPRODUCT(COUNTIF(INDIRECT("'Week"&{1,2,3,4,5,6,7,8,9,10}&"'!Y3"),"W"))
I would like to have a cell in my workbook that contains, A1:
1,2,3,4,5,6,7,9,10
So that way I can update only one cell when I add a worksheet to be counted. I've tried a few things and nothing seems to work.
Your formula : =SUMPRODUCT(COUNTIF(INDIRECT("'Week"&{1,2,3,4,5,6,7,8,9,10}&"'!Y3"),"W"))
This formula only work if you have 10 sheets with named Week1,Week2,Week3….Week10
But if you have less than 10 sheets e.g. Week1,Week2,Week3….Week9, your formula will fail and return "#REF!" error
The formula workaround is wrapping with a IFERROR() and become :
=SUMPRODUCT(IFERROR(COUNTIF(INDIRECT("'Week"&{1,2,3,4,5,6,7,8,9,10}&"'!Y3"),"W"),0))
However, if you wanted the formula acting dynamic and in A1 enter : 1,2,3,4,5,6,7,9,10
But 1,2,3,4,5,6,7,9,10 is a text string, you need converted it to an array. Using FILTERXML() can do the work of which available since Excel 2013
This is an array formula you need to confirm by pressing CTRL+SHIFT+ENTER instead of just ENTER:
=SUM(IFERROR(COUNTIF(INDIRECT("'Week"&FILTERXML("<a><b>"&SUBSTITUTE(A1,",","</b><b>")&"</b></a>","//b")&"'!Y3"),"W"),0))
EDIT 1 :
And,
if you haven't Excel 2013, you could use this longer array (CSE) formula instead
=SUM(IFERROR(COUNTIF(INDIRECT("'Week"&TRIM(MID(SUBSTITUTE(","&A1,",",REPT(" ",99)),ROW(INDIRECT("1:"&LEN(A1)-LEN(SUBSTITUTE(A1,",",))+1))*99,99))&"'!Y3"),"W"),0))
After that,
you can make adjustment to A1 number without changing formula contents
AFAIK you can't do that with a formula if you place the sheet list in a single cell I stand corrected: see bosco_yip's answer! (although you could with a UDF).
But, if you place your sheet list in a column, you can do this (using OFFSET, the list is dynamic, but must be the only data in that column. There are alternatives if that doesn't suit you):
=SUMPRODUCT(COUNTIF(INDIRECT("'Week"&TRANSPOSE(OFFSET(A1,1,0,COUNTA(A:A)-1,1))&"'!Y3"),"W"))
Applying the FILTERXML method, to create a non-array formula
=SUMPRODUCT(COUNTIF(INDIRECT("'Week"&FILTERXML("<a><b>"&SUBSTITUTE(A2,",","</b><b>")&"</b></a>","//b")&"'!Y3"),"W"))
It's probably a simple problem, but I did not even know the keywords to google it ;/. Let's say I have this data :
Now I also have this litle formula:
If I know drag the C cell to the right, Excel will attempt the following caluclation:
=2+B1
What I want him to do is to attempt this calculation
=2+A2
Of course the easiest solution would be to store my initial data in one row instead of 1 column, but it is really inconvenient for me. Thanks for any help
You can use the indirect() method to reference a cell by it's "String identifier", i.e. "A3". When filling out to the right, use CONCATENATE() and COLUMN() to create your String identifiers {A1,A2,A3,A4,A5...} as required:
=2+INDIRECT(CONCATENATE("A";COLUMN()-2))
This will result in the following:
Side-Node: If you want this for some x/y-Grid-Generation, you can also be lazy,
and just insert =COLUMN() for every cell from "A1 - Z1" and ROW() for every cell from "A2 - A24".
(Or even avoid these at all and directly perform your actual calculation by using column() and row() as replacement for your x/y.
You may try using a combination of the INDIRECT and COLUMN functions:
=2+INDIRECT("A"&(COLUMN()-2))
You would paste the above formula into cell C1, and then drag across to the right however many columns/rows you wanted to cover.
This would result in the following:
This works because COLUMN()-2 returns 1 for the C column, 2 for the D column, and so on. Therefore, the formula will be calling INDIRECT on A1, A2, etc. for column C, D, and so on.
In general, if you want relative references to move down as cells are dragged to the right, you can use this:
Instead of:
= 2+A1
Do:
= 2+INDEX($A:$A,COLUMN()+<offset>)
Where <offset> is whatever offset you need. The offset will change depending on which column the starting formula is located in.
INDEX should be preferred over INDIRECT because INDIRECT is volatile (must recalculate after any change to the workbook) but INDEX is not (only recalculated when one of the inputs the formula, in this case $A:$A, changes).
I am straggling with some formula that I have a spreadsheet that contains two range of cells. What I want to do is,
I would like to create a search Box that will search a value from Range A and if found return range B value and also will count of range B value is repeated.
Below image is for what I mean
I used INDEX, MATCH and also IF Functions :( but not really get what I wanted.
I am poor in formula, so it would be great if someone can figure out what kind of functions I should use for this.
For information, it can be achieved through formula as below.
E3 houses the value being searched for e.g. "A"
In cell F3 insert following array formula which needs to be committed by hitting CTRL+SHIFT+ENTER simultaneously.
=IFERROR(INDEX($B$1:$B$1000,SMALL(IF(IFERROR(MATCH($E$3&$B$1:$B$1000,$A$1:$A$1000&$B$1:$B$1000,0),0)=ROW($B$1:$B$1000),ROW($B$1:$B$1000)),ROWS($A$1:A1))),"")
Copy down as much as you need.
You need to adjust 1000 to suit your data. It should match last row.
In cell G3 you can use following formula.
=IF(F3="","",COUNTIFS(A:A,$E$3,B:B,F3))
Copy down as much as you need.