Sumif with right and/or replace

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
I am trying to use sumif =SUMIF('Sales'!$A$1:$A$15237,'Monthly'!A1,'Sales'!$D$1:$D$15237)

The problem is that the data in Monthly A1 is text written as yyyy/mm which I cannot convert to a value unless I use something like RIGHT or REPLACE:

=RIGHT('Sales'!A1,1)+0 or

=REPLACE('Sales'!A1,1,5,"")

I don't know how to:

(a) apply either of RIGHT or REPLACE to a range of cells, and
(b) build this argument into my SUMIF.

Any advice would be appreciated.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
[TABLE="width: 194"]
<colgroup><col width="66" style="width: 50pt; mso-width-source: userset; mso-width-alt: 2413;"> <col width="64" style="width: 48pt;" span="3"> <tbody>[TR]
[TD="width: 194, bgcolor: transparent, colspan: 3"]Eg. Monthy A1= 2018/1[/TD]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, colspan: 4"]In B1-B6 I used the formulas below to check A1[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, colspan: 3"]=ISNUMBER(A1) result = #VALUE![/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, colspan: 3"]=DATEVALUE(A1) result = #VALUE![/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, colspan: 4"]=ISERROR(DATEVALUE(A1)) result = TRUE[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, colspan: 3"]=ISTEXT(A1) result = TRUE[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent, colspan: 3"]=CELL("format",A1) result = G[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]

The question does not involve 'Monthly'!A1. Rather: $A$1:$A$15237 of Sales.

What does

=ISNUMBER(Sales!$A$1)

return?
 
Upvote 0
Apologies - that was a typo - I meant Sales not Monthly. In Monthly I have eg. for Jan in A1=1 and it is a number
 
Upvote 0
Monthly A1=1
Sales A1=2018/1

ISNUMBER('Monthly'!$A$1)=TRUE
ISNUMBER('Sales'!$A$1)=#VALUE!
 
Upvote 0
You need to be careful using 1 to represent January. Your sheet can never span more than one complete calendar year or your SUMIF will be incorrect.
 
Upvote 0
Monthly A1=1
Sales A1=2018/1

ISNUMBER('Monthly'!$A$1)=TRUE
ISNUMBER('Sales'!$A$1)=#VALUE!

Is this then what we want?

[a]
=SUMIFS('Sales'!$D$1:$D$15237,'Sales'!$A$1:$A$15237,2018&"/"&'Monthly'!A1)

Or this?


=SUMIFS('Sales'!$D$1:$D$15237,'Sales'!$A$1:$A$15237,"*"&"/"&'Monthly'!A1)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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