# Possibly If/Then Statement

1. ## Possibly If/Then Statement

I need help writing an if/then statement.

A certain row, for example, lets use row 3, will have a "C" in it, which will move from month to month, but will never be in the same column twice.
Ultimately, this is what I want the formula to calculate. Let's use K5 as the cell where I would be entering this formula. Detect the cell in L3:AF3 which equal "C" then multiple that cell in row 5 by G5. (For example, if "C" was in Q3, the K5=Q5*G5). How would this formula/if--then statement be written?

Thanks for the help!  Register To Reply

2. ## Re: Possibly If/Then Statement

It's a little tricky to work out quite what you're after, but I think in K5 you'd want ...

=G5 * OFFSET(K5,0,MATCH("C",K3:AF3,0)-1)

Just realised that's going to give you a circular reference warning, because K5 is both the cell containing the formula and, possibly, the cell containing the value to be multipled by G5. That formula would work fine in, say, J5 though.  Register To Reply

There are currently 1 users browsing this thread. (0 members and 1 guests) 