I'm having some trouble with the below formula:
=IF(Data!X:X = 1,
IF(Data!H:H = "Horse",
IF(Data!U:U = A5, COUNT(Data!U:U)),0)
I need to check if column "X" in the excel sheet "Data" as the value of "1" if so, I need to check another column (in the same sheet) to see if it contains a particular text element(like: horse"), then I have to check to see if the column U in sheet "Data" contains the same value as my active sheet A5 if all the criteria match I need the count of how many times this occurs.
however my formula is only returning FALSE. I narrow it down to this part;
"IF(Data!H:H = "Horse")
now I double check , all the IF should end up as true.
Obviously I have something not right, any help would be great.
If you have Excel 2007 or later, you can use:
=COUNTIFs(Data!X:X, 1, Data!H:H, "Horse", Data!U:U , A5)
For Excel 2003:
=SUMPRODUCT((Data!X:X = 1)*(Data!H:H = "Horse")*(Data!U:U = A5))
Looks like the formula is incorrect (missing some of the false clauses in the if statements). This works for me:
=IF(Data!X:X = 1,
IF(Data!H:H = "Horse",
IF(Data!U:U = A5, COUNT(Data!U:U),0),0),0)
Related
I would like to write a function in Excel that finds the last value in the row and copies the information to a different cell.
i.e last info is on cell row 2 column AX = 'hello', then to copy it to row 2 column F.
Thank you.
This is as simple as selecting your desired cell (F2) and typing =AX2 in the formula bar.
If 'hello' is written in AX2, it will be automatically copied to F2.
I suppose if you wanted to employ a user control and VBA to accomplish this, this code would work.
Dim str as String
str = Range("AX2")
Range("F2") = str
Or even simpler
Range("F2") = Range("AX2")
I am trying to generate an Excel sheet using Exceljs on NodeJS.
I need to get a particular cell (E4) for which I have this code written.
var row = worksheet.getRow(4);
var compInfra = row.getCell(5);
The cell ('E4') contains a value as the result of a formula ('E4 = C4+D4'), which I have defined previously. C4 and D4 contain non zero numbers.
I need to use this resultant value of the formula in a subsequent statement as below:
row = worksheet.getRow(20);
row.getCell(5).value = compInfra * worksheet.getCell('A20');
I get no output on my Excel sheet at 'E20', since the value in 'E4' is a result of the formula.
If I choose any other cell with some value instead of a formula, I get the result correctly.
How do I address this issue.
Thanks in advance
worksheet.getCell('E4').value = { formula: 'C4+D4' };
worksheet.getCell('C4').value = 7;
worksheet.getCell('D4').value = 5;
https://github.com/exceljs/exceljs#formula-value
I need to compare a product from a transaction file to a product in a lookup worksheet. The values appear to be equal but do not evaluate as equal. Been trying different approaches in VBA (StrComp, CStr, Trim(), adding a letter to the beginning and end of the strings for comparison) and Excel formulas to try and solve this.
In the photo,
Cell C4 was copied from the transaction work book, and cell D4 was copied from the lookup workbook. The formula evaluates to False. If I just type this string value into two different cells and apply the formula, it evaluates to True, but when I copy the two cells from other workbooks (a transaction worksheet, and a lookup worksheet), the formula evaluates to false.
Any ideas?
Excel Formula: =IF(TRIM(UPPER(C4))=TRIM(UPPER(D4)),TRUE, FALSE)
A5314A A5314A
In Excel using the CLEAN function like Chris Neilsen suggested was the answer:
=IF(TRIM(UPPER(CLEAN(C4)))=TRIM(UPPER(CLEAN(D4))),TRUE, FALSE)
As Sam suggested in VBA using this function also worked and the StrComp method evaluated to 0:
a = "A" & Application.WorksheetFunction.Clean(Trim(CStr(Sheet1.Cells(i, 1).Value2))) & "A"`
b = "A" & Application.WorksheetFunction.Clean(Trim(CStr(Sheet2.Cells(i2, 1).Value2))) & "A"
If StrComp(a, b) = 0 Then
Want to try and do this within excel;
If a cell (d2) = JOHN
Then Cell (f2) = (e2*0.16)
So basically trying to say if the name is a name then the amount in cell f is * by 0.16p
IF function syntax,
IF(logical_test , [value_if_true] , [value_if_false])
So your formula should be, (please see image)
=IF(D1="John",E1*0.16,"Not John")
You can change the "Not John" per your needs.
I have an id column on 2 excel sheets. For ex, on one sheet A1 = 831250, A2 = 831251, A3 = 831252. On the other sheet, A1 = 250, A2 = 251, A3 = 252. As you can see, the first sheet has a prefix of 831 in the id column. I am using the formula below, however it is returning the same result for all, which is the total for all 3. Is this a bug, or is there an error in my formula? Weird thing is that VLOOKUP works.
=SUMIF('831 Summary'!$A:$A,"831" & Comparison!$A2,'831 Summary'!$F:$F)
"831" & Comparison!$A2 is creating a literal text string. A text string does not equal a number.
Try --("831" & Comparison!$A2) instead. It will convert the text string back to a number.
=SUMIF('831 Summary'!$A:$A,--("831" & Comparison!$A2),'831 Summary'!$F:$F)