Budianto IP
Budianto IP

Reputation: 1297

Build a formula based on some cell values

The solution I'm looking for is a non-vba one, hopefully there's any.

Build a formula

I'm planning to build a formula at B7, something like =SUM(B3:B5), but the value B3 and B5 is taken from C7 and D7.

I'm working on a weekly employee salary tables, a sheet can contain some employee salary tables, broken down into week by week, using the ordinary SUM function will take more efforts, so I'm looking for an easier way to do it.

Any clues would be much appreciated.

Upvotes: 1

Views: 288

Answers (2)

P.b
P.b

Reputation: 11415

To avoid this you could also choose to show the total value in a different column and a simple =sum($B:$B) would do. But above is the answer to your specific question.

Upvotes: 0

Henrique Branco
Henrique Branco

Reputation: 1930

This is my solution, use the following formula:

=SUM(INDIRECT(CONCATENATE(C7,":",D7)))
  • CONCATENATE to join both cells in order to form the range C7:D7.
  • INDIRECT to transform your text into a valid range.
  • SUM to sum the specified range.

Upvotes: 1

Related Questions