Indirect problem

handysmurf

Board Regular
Joined
Jan 17, 2015
Messages
89
Office Version
  1. 365
Platform
  1. Windows
I'll perhaps get more in depth if needed but for now is there anything obviously wrong with this formula?

I'm trying to narrow down the problem by breaking the formula down into pieces. Here is what I've done and where it breaks.

"=SUM(INDIRECT($U$2&$G39):INDIRECT($U$2&$H39))" This works

"=SUMIF($R$5:$R38,"D",U5:U38)" This works

"=SUMIF($R$5:$R38,"D",INDIRECT($U$2&$G39):INDIRECT($U$2&$H39))" This is where it breaks and returns $0, not the answer I want.

It gets more complicated ultimately but this is the hurdle.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Try this:

=SUMIF(INDIRECT("R"&$G39&":R"&$H39),"D",INDIRECT($U$2&$G39&":"&$U$2&$H39))
 
Upvote 0
Um no that returned a number way off

Im trying to figure out how to upload the worksheet thing.... ?
 
Upvote 0
wait that did work.... autorecover hit and it opened up a workbook where I had added two colums. Once I deleted those it works.

Thanks so much.... hopefully i can manage to parse that for other cells ... projects,... issues
 
Upvote 0
So apparently it doesn't like to mix direct cell references and indirect cell references in the same formula?
 
Upvote 0
So apparently it doesn't like to mix direct cell references and indirect cell references in the same formula?

That unlikely to have been the real issue.
The real issue is that each range has to match in term of starting and finishing at the same row
You have hard coded one range as being rows 5:38.
Having any other range as variable (aka indirect) doesn't then make sense since the formula requires the other range to also be rows 5:38
 
Upvote 0
the formula requires the other range to also be rows 5:38
It doesn't actually. The ranges need to be the same shape/size, but they don't need to be related in any other way. You could have criteria in rows 2 and 3 and values in rows 4 and 5 and it would still work. (it would be a weird spreadsheet though)
 
Upvote 0
It doesn't actually. The ranges need to be the same shape/size, but they don't need to be related in any other way. You could have criteria in rows 2 and 3 and values in rows 4 and 5 and it would still work. (it would be a weird spreadsheet though)

I did not know that. I don't think it qualifies as TKO though ;).
As you said it would be a weird spreadsheet that had the criteria range and sum range the same size but out of alignment.

@handysmurf - to recap having one of the ranges being variable while the other is static doesn't make sense since you want them to line up ie be in sync.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,433
Messages
6,124,861
Members
449,195
Latest member
MoonDancer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top