Searching a letter within a range in excel

55 Views Asked by At

I need an excel formula that searches within a range, a cell that contains a word with letter "W" and then multiply the number stored in the cell from the right of it by 2 and display the sum of all this multiplied values in another cell. Example: Range A4:Y4; B4 contains word "Woo" and C4 contains number "3"; E4 contains word "Wood" and F4 contains number "5"... I need Z4 to contain C4*2+E4*2+... Please help me with that.

2

There are 2 best solutions below

3
LukasV On

Try this in Z4:

=SUM(SUM(OFFSET($A$4,,IF(IFERROR(FIND("W",$A$4:$Y$4),0)>0,COLUMN($A$4:$Y$4)))))

Hit CTRL + SHIFT + ENTER.

  1. Make sure A4 is not a number (otherwise this formula counts the value of A4 times the number of cells that don't contain "W").

  2. If you want to count cell as well that contain small w's, use SEARCH instead of FIND (SEARCH = case insensitive; FIND = case sensitive).

  3. Keep in mind: OFFSET is a volatile function, i.e. if you have a large datasheet, this might slow down the work a bit.

0
Boris Turcu On

Found it!

=SUM(IFERROR(2*(LEFT(A4:X4)="W")*B4:Y4,0))

Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself.