SOLVED

Formula HELP!!

Copper Contributor

 Hi Everybody.

I’m struggling with formula and wonder if you can help.

I have 2 spreadsheets. The first one represents a list of payments made on a particular day of the month.

The columns are date, room number, amount.

The second spreadsheet represents a table with days (horizontally) from the 1st day of the month thru 31st and room numbers (vertically) in the 1st column from 100 thru 150.  

I’m trying to achieve a compact view of the entire month with the 2nd spreadsheet by populating appropriate cells in the 2nd spreadsheet based on payments made during the month.

I use Index function with two match factors (one based on room number and one based on date), but it doesn’t always work right.

The issue is that I have to scan the room numbers from the beginning for every payment as well as dates.

Any help is greatly appreciated.

 

Mark

8 Replies

Hi Mark,

 

The idea is correct, what exactly doesn't work? Perhaps you may attach sample file or at least give exact formula you use.

 

@MarkK777 

HI Sergei. As you can see in the attached file, I can't get the right value into the corresponding cells based on the room number and the date. The room number in the match function returns the room number, but the date in the match, returns relative row number.
So I kind of stuck here.
Thanks again for a quick response

Hi Mark - unfortunately there was no file attached, could you please repeat it.

@MarkK777 

@Sergei Baklan 

Here it is

best response confirmed by MarkK777 (Copper Contributor)
Solution

Mark, you takes the value from 1D array and shall position row in it using two criteria (date and room #), not row and column.

 

It could be

=IFERROR(  INDEX($U$3:$U$19,  MATCH(1,  INDEX( ($A3=$T$3:$T$18)*(B$1=$S$3:$S$18),0),0 )  ), 0)

INDEX within MATCH generates array of TRUE and FALSE (or 1 and 0) depend on criteria is met or not. Multiplication means AND condition.

Please check in attached.

 

@MarkK777 

@MarkK777 

I would suggest a pivot table.

Date in the columns area, Room # in the rows area and Pay in the values area.

 

@Sergei Baklan 

Sergei,

 

THanks a lot.  It really helped

@MarkK777 , you are welcome

1 best response

Accepted Solutions
best response confirmed by MarkK777 (Copper Contributor)
Solution

Mark, you takes the value from 1D array and shall position row in it using two criteria (date and room #), not row and column.

 

It could be

=IFERROR(  INDEX($U$3:$U$19,  MATCH(1,  INDEX( ($A3=$T$3:$T$18)*(B$1=$S$3:$S$18),0),0 )  ), 0)

INDEX within MATCH generates array of TRUE and FALSE (or 1 and 0) depend on criteria is met or not. Multiplication means AND condition.

Please check in attached.

 

@MarkK777 

View solution in original post