Problem with IF AND and Vlookup nested formula - excel

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.

Related

I want to copy a formula which ends in a number, but amend the number in the new formula by a fixed value

In Cell F190 I have the following formula: ='[Account 19617768.xlsx]19617768'!$G$1142 (the cell displays the value in 19617768 $G$1142 - (£1609.50)
I can display this formula in Cell J190 with the formula: =FORMULATEXT(F190)
By manipulating FORMULATEXT(F190) (i.e. Using Left(FORMULATEXT(F190),38)&(Right(FORMULATEXT(F190),4)+2), I end up with Cell J190 displaying formula: ='[Account19617768.xlsx]19617768'!$G$1144.
What I need is for Cell J190 NOT to display the formula, but the actual value in Account19617768.xlsx G1144 (£1859.50), and it's the conversion of the formula into the value I don't seem to be able to find an appropriate function
I don't have a problem if I need to use an additional function in another cell to finish off the conversion?
I know this should be easy, but having just been released from hospital, I seem to be having
trouble working the simplest things out
'$' signs in excel formula keep the preceding data static.
In other words. Remove the $ in G$1065.
Now when you drag the formula down the column the Cell number will increase.
If you keep the $ in front of G the column G will never change no matter where the formula is copied.

Count Blank Cells Until Value is Found

How can I find a count of blank cells until a value is found in a row?
I did some searching and found that I could use either
COUNTBLANK with INDIRECT or COUNTIF or MATCH with INDEX
But couldn't get it to work on any of them...
The formula should go into B5.
Example:
Thank you for the help.
Use MATCH() Function:
=MATCH(FALSE,ISBLANK(B1:F1),0)-1
That formula will give you the number of cells to the first non-blank cell, so if you substract one you’ll get the number of blank cells. As is an array formula confirm it with CRTL+SHIFT+ENTER instead of ENTER so you get the brackets {} in the formula:
{=MATCH(FALSE,ISBLANK(B1:F1),0)-1}
Please try this basic Lookup function. (This is normal function which means no need to confirm CTRL+Shift+Enter.)
This below function needs to be written on A1 then you can drag it down.
=LOOKUP(2,1/($A1:G1<>""),COLUMN($A1:G1))-2
You can use a combination of MATCH and MAX (or MIN) for this:
Formula in B5:
=MATCH(MAX(B1:G1),B1:G1,0)-1
Drag down

using a cell from another sheet as reference

I wrote a formula which calculates the inputs in "Sheet2" which is below. So J4 is a cell of Sheet2:
=((COUNTIF((INDIRECT(ADDRESS(ROW(J4);COLUMN(J4))&":J"&
(MIN(IF(A4:A107="";ROW(A4:A107))))));"
<>"&""))-1)/((COUNTIF((INDIRECT(ADDRESS(ROW(J4);COLUMN(J4))&":J"&
(MIN(IF(A4:A107="";ROW(A4:A107))))));"<>0"))-1)
Now I want to write this formula to a cell in Sheet1.It means i should reference the Sheet2 for calculating the formula.
Can anyone help me with referencing?
EDIT: I still am without solution for this issue. Can anyone suggest me something new then in the comments?
Looking at your formula, it seems you want to evaluate ratio of:
Count non-blank cells in column J where column A is also non-blank.
Divide this count by count of non-zero cells in column J where column A is non-blank.
If yes then test following formula and see if it works per your needs:
=COUNTIFS(Sheet2!A4:A107,"<>",Sheet2!J4:J107,"<>")/COUNTIFS(Sheet2!A4:A107,"<>",Sheet2!J4:J107,"<>0")
Make sure you change argument separators.
Edit
In that case, you need to use following array formula (CTRL+SHIFT+ENTER) and change argument separators.
=COUNTIFS(Sheet2!A4:INDEX(Sheet2!A4:A107,MIN(IF(Sheet2!A4:A107="",ROW(Sheet2!A4:A107)))),"<>",Sheet2!J4:INDEX(Sheet2!J4:J107,MIN(IF(Sheet2!A4:A107="",ROW(Sheet2!A4:A107)))),"<>")/COUNTIFS(Sheet2!A4:INDEX(Sheet2!A4:A107,MIN(IF(Sheet2!A4:A107="",ROW(Sheet2!A4:A107)))),"<>",Sheet2!J4:INDEX(Sheet2!J4:J107,MIN(IF(Sheet2!A4:A107="",ROW(Sheet2!A4:A107)))),"<>0")

Count Number of Instances of string using FORMULATEXT

I have data that extends from column A1 to F1. All the cells contain VLOOKUP formulas looking up data from an external Excel file.
I want to be able to insert a formula in column G1 to count the number of times a certain filename is used in columns A1 to F1.
I know that if the data in cells A1 to F1 were NOT formulas I could use something like the below in G1 if I was searching for the string "filename.xlsx" using wildcards:
=COUNTIF(A1:F1, "*filename.xlsx*")
However, as A1 to F1 contain formulas, I assume I would need to use FORMULATEXT, in order to look within the VLOOKUPs. I have tried the below, but it doesn't work:
=COUNTIF(FORMULATEXT(A1:F1),"*filename.xlsx*")
Does anyone know if there is a way to do this? it would also be good if the criteria within the COUNTIF was a cell reference. However, that isn't essential.
Thanks
Try using this array formula
=COUNT(SEARCH("filename.xlsx",FORMULATEXT(A1:F1)))
confirm with CTRL+SHIFT+ENTER
or a non array version.....
=SUMPRODUCT(ISNUMBER(SEARCH("filename.xlsx",FORMULATEXT(A1:F1)))+0)

Dynamical SUMIF command

If it is possible, I'd like to create a formula that will allow me the following:
Formula must be in the entire column or in this example, in the range B1:B5. The formula is based on a condition, that when the total sum of cells from column A is lower D1, than it gives "X". If the total sum is over D1, then it gives an empty field - "".
In this example the total sum of the cells, that are over D1 value is in the first 3 rows, hence the three X-es, and then it stops.
(source: shrani.si)
.
I presume it would be possible to do this with multiple SUMIF commands, but does anyone know a smoother solution for this?
Thanks!
You can do this easily by using an absolute reference for the starting point of a SUM and using a relative reference for the end point. When copied down, this formulas works fine.
=IF(SUM($A$1:A1)<$D$1,"x","")
Results
Try this
=IF(SUM(OFFSET(A1,0,0,$A$1:A1,1))>$D$1,"X","")
This formula should start at B1 and then you use auto-increment to populate other cells

Resources