Does anyone know how I can write an if statement that searches for partials in VBA? For example, if A2 and A3 both contain Jon, I would like the totals under the 2020 column to be summed, and then it would move down and check the values in A4 and A5. It should work the same way for Mary. But with ben, it should only total A6 because the cell underneath contains Chip. Then it should go down again and check the following two cells for a match. This is for a report that changes weekly, so the names will not always be the same. Any help is appreciated. Thank you.
As Rno said, name uniques would become an issue, but for this small data set you can add another column of name values in column F and do a sumif formula on those separated names.
See Formulas Used Pic
In cell f2 =TRIM(RIGHT(A2,LEN(A2)-FIND("-",A2,1)))
In cell H2 =SUMIF($F:$F,$G2,B:B)
Related
I have a master workbook with two columns: names and formulas, which are specific for certain names. Generally, there are some 300 different names and 10 different formulas. What I need is to insert that formula in another sheet when some of this names appear - some kind of vlookup formula which won't give me value but formula.
And second part of a problem is how to make this formula (if it can be somehow inserted) dynamic and use relative values for calculation from same row in calculation sheet....
Please see my simulation below. My formula is F3 (ignored = sign) and its name is Name1. For test purpose, I typed 7 into cell F3 and 8 into cell F4.
With the formula below I typed in sheet2, I am able to call the formula of =F3 and change the reference given to cell F3 to F4 and reach to result of 8 in master sheet.
=INDIRECT("Master!"&SUBSTITUTE(VLOOKUP("Name1",Master!$I$3:$J$10,2,FALSE),"3","4"))
Maybe you can solve your puzzle by using functions I used in above simulation (INDIRECT and SUBSTITUTE).
I hope I can explain sufficiently for someone to understand and be able to help, I have 27000 records to update into one column.
I'm hoping to use a formula to fill column D with data from column A but if that cell is blank use data from column B and again if that column is blank use data column c.
]: https://i.stack.imgur.com/DTwI7.png
Try this:
=IF(A1<>"",A1, IF(B1<>"",B1,IF(C1="","",C1)))
This doesn't use IF, and so is more flexible for use with longer ranges.
=INDEX(FILTER(A1:C1,A1:C1>"",""),1)
It FILTERs the row for non-empty text cells, and returns the first one via INDEX.
May be like this in your cell D2
=IF(A2<>"", A2, IF(A2="", B2, Value(C2)))
I have the following scenario.
Driving Toyota Hilux Best
Driving Mitsubishi Triton
Driving Ford Ranger Good
Driving Hilux Best
Driving Ranger Good
I would like to use a formula to automatically rearrange the upper table to the lower table.
I was actually trying to eliminate all rows with empty cell in fourth column and then remove the second column.
What formula should I use ?
Thank you.
In A6, copied across and down :
=IFERROR(INDEX($A:$D,MMULT(SMALL(($D$1:$D$3="")/1%%+ROW($1:$3),ROWS($1:1)),1),INDEX({1,3,4},COLUMN(A1)))&"","")
As per below screenshot use following formula to A6 cell.
=IFERROR(INDEX($A$1:$D$3,AGGREGATE(15,6,ROW($1:$3)/($D$1:$D$3<>""),ROW(1:1)),1),"")
You need to change Column reference of INDEX() formula for 2nd and 3rd column as you want to skip B Column. So, for cell B6 formula will be...
=IFERROR(INDEX($A$1:$D$3,AGGREGATE(15,6,ROW($1:$3)/($D$1:$D$3<>""),ROW(1:1)),3),"")
If you notice Column argument is 3 here because we skip column 2 of your source data.
what i want is for cell C10 to contain the value of column 5 in my table, only if column 1 and 2 both match the date and name in cells a1 and b1
ive tried to achieve this with a formula but i can only get it to compare 2 things, formula below.
i can get it to match the date in the sheet with the date in the table, then give me column 5's value for that matching row, but i cant get it to acknowledge the name as well so cell C10 is getting a note for someone else because the dates match despite the names not matching.
i have also included a mockup up with 4 examples of what should be happening.
I think it is possible it can be done by formula, i found something when i was trying to google this problem but i dont have a clue what its talking about and i feel like it would be really easy with vba
https://exceljet.net/formula/index-and-match-with-multiple-criteria
=INDEX(TblNotes[#All],MATCH(Date,TblNotes[[#All],[Date]],0),5)
you may want to use Database formulas
insert a row above the first one
write "Date" and "Name" in cells A1 and B1 respectively
place the following formula in C10
=DGET(TblNotes[#All],"Comment",A1:B2)
I am working on a personal budget sheet in excel, and it's formatted based on my pay dates, to provide more drilled-down information. I have attached an example of it below for reference.
I would like to put a formula into J2, J3, and J4 which will take the data in cells C9:C26 and H9:H16, match it to the date in cells D2:D4, then subtract the expenses in D9:D26 and I9:I16 from E2, E3, and E4.
As you can see, I have just individually summed the cells; however, I would like a formula to be able to adjust as I change the value in cells C9:C26 and H9:H16.
I have found that I can do it with ONE cell, but not multiple or a range. This is the formula I used, and I cannot find a way to make it apply to the entire range of cells: =IF(C14=D3,E3-D14)
I've also tried: =IF(C9:C25=D3,E3-D9:D25) -- I know this formula doesn't work and why. I cannot figure out how to get column C to correspond with column D.
The Budget Sheet
You just need to use SumIf().
In cell J2, put this formula: =SumIf($C$9:$C$25,$I2,$D$9:$D$25)+SumIf($H$9:$H$25,$I2,$I$9:$I$25) and drag down the three cells.
With that, you can add E2-[formula] to subtract all that from E2. Or of course, just do e2-J2 instead. I think that should do what you're looking for. If it's not quite it, let me know and I can tweak.
If you plan to have more than 1 criteria go with SUMIFS
Yes, with S